Many minor updates, mainly aliased range->xrange for python version 2 in all files that used range