Python 3 support

Python 3 support, didn't take much.

Also, formatted via autopep8.