Several py3 fixes.
Using six.moves.xrange and let the line limit be 100 char.
List comprenhension instead of list(map).
Merge pull request #473 from damianavila/more_py3_fixes

Several py3 fixes.