Make this work with Python 3, and do some minor cleanup

* Works with Python 3.3.5 and 2.7.7
Revert formatting changes
Merge pull request #4 from thentenaar/master

Make this work with Python 3