Basic Python 3 support

Admittedly, I haven't tested this much beyond running tests.py.
Merge pull request #2 from JNRowe/f/python3

Basic Python 3 support. Thanks JNRowe!