A bit of Python3 support

This is my contribution to #11. It is yet far from full Py3 support, but at least something.