ensure portability to python 3
Merge pull request #57 from anarcat/py3

[various]Python3 ready