s/xrange/range/ for python 3.

Closes #681.