Python 3 support

Easily verifiable changes.