Python 3 support

Fairly simple conversion to Python 3. I _think_ it works, but your test suite doesn't pass... At least it doesn't add any new test failures.

The depends on #42, so I guess I'd rebase once that's merged.