Get the test suite passing in Python 3

Details in the commit messages.