Remove usage of xrange.
Cleanup unused imports.