Python3 porting

Fixes #5