extend the validate_slength function to accept a minimum length

I extended the function to accept a third parameter giving a minimum length of the string. This parameter is optional.
I also updated the tests functions. The error messages change a bit in that they now say "should be between x and y characters", if the string has not the right size.

The default for the min length is zero.

My use case was a security token, which had to be of a certain format (min length and max length).