Basic Python 3 support

Admittedly, I haven't tested this much beyond running tests.py.