Python 3 fixes caught by python-modernize

python-modernize (https://github.com/mitsuhiko/python-modernize) is a
useful wrapper around 2to3 which comes with sane defaults.

The fixes below were generated by running

    python-modernize --compat-unicode -w .

and then fixing all lint errors.