Switch to developing using Python 3

I've switched my virtualenv from Python 2 to Python 3. This is the only
line that was unhappy about the switch. I'm adding `NOQA` to tell flake8
to ignore `unicode` not being defined.
Continue transition to Python 3 first with range

The code was already written to use `range()` instead of `xrange()`.
Unfortunately this meant that Python 2 was using `range()` instead of
`xrange()`. `_compat.xrange` (which wasn't being used anywhere) is being
replaced by `_compat.range` as part of the Python 3 first transition.

Any module using `range()` is now importing it from `_compat`.