Added python2 support

Needed to use this library in a project with python2, so added some code to make that happen.
Seems to be working fine, with some test files.

(Is there a reason why python2 isn't supported?)