#76: Various cleanups and Python 3.x compatibility

See commits for more details