`xrange` doesn't exist in Python 3.

I can replace this with `six.moves.range` ... his will give `xrange` in Python 2 and `range` in Python 3, i.e. in both cases the high-performance version. I only use it in high-performance code and just use the simpler `range` elsewhere (which means non-optimal performance on Python 2).

@wkerzendorf I can quickly update this to use  `six.moves.range` if you prefer ... let me know.