Python 3 compatibility using six.string_types

using basestring breaks the library on Python3, this fixes the issue if you are ok with using six