Python 3 compatibility

I want to make the source code of this library compatible with Python 2 and 3.