Only accept strings

Running strlen() on non-strings is not a good idea
Adding tests

Adding tests that show how I have forgotten the proper use cases :/