Cleanup the tests and other code for various versions.

python <= 3.2 doesn't care for for u'' strings but unicode_literals
from __future__ has side effects we don't want.

Other fixes from flake8