xrange to range for python3

Works with 3.3.2 now
Merge branch 'master' into testing