Python 3 support

* Replace legacy print statement usage with print functions
* Stop using dict.iteritems()
* Minor PEP-8 cleanup
* Add a basic smoke test