Fix Python 3 incompatibilities (fixes #3)

See ticket #3 for rationale.

Test for Python 3.2 with tox fails due to errors in werkzeug, so I left it out of the list of environments to test in `tox.ini`.