Mod: add support to py3k

This commit added support for py3k. Specifically, this commit uses `range` instead of `xrange`, and use `print` function instead of `print` expression.

Tested under Python2.7 and Python3.4, should work on any python version in between