Unbreak the tests that are still possible on Python 2

Most of the tests will now pass in Python 2. The excluded tests are:

- Tests for the readers -- the tester uses Python 3-specific code, and
  this makes sense because the readers should never be run under Python
  2 anyway
- Doctests, because Python 2 string literals look different