Get parse.py at least mostly working under Python 3.

This could badly do with refactoring; it's likely with some set of options this will still not work. Fixes #23.