Python3 compatibility

Closes Issue #7.