Port code to Python 2. Close #25

If run as an executable on Unix or with the py.exe program on Windows,
Python 3 will be used by default. Otherwise, invocation by `pythonX
cansen.py` will work for 2 and 3