Improve tests

Fix the Windows test failure (bug #27) by checking against basestring (super class of str and unicode) for Python 2.

More details: https://stackoverflow.com/questions/1979004/what-is-the-difference-between-isinstanceaaa-basestring-and-isinstanceaaa