Fix to support unicode

Addressed sourceforge issue #7, although I checked if an instance of
basestring, which both str and unicode inherit from:

http://stackoverflow.com/questions/1303243/how-to-find-out-if-a-python-object-a-string