Added basestring as a ref to str
Fixed 'StringIO' import for python3
Fixed problem with divisions truncation in python3
Ported code to python3 fixes #15
Merge pull request #21 from marcwebbie/master

Ported code to python3