Python 3 support.

At least tentatively, as I have no real actual use case. But tests pass.

Warning: It does drop Python 2.5 support.