COMPAT: Allow Python 3 compatibility. Closes #2.

This should allow building on Python 3. I didn't run any tests but it looks like it builds ok.