Patch which makes the module work in Python 3

Here is a patch which makes the module work in Python 3.*.
`isinstance(basestring)` raises a NameError in Python 3.* because type of `basestring` is not supported.