Python 3 port
Cleanup
Cleanups and some unit tests