Initial work for Python3 compatibility.

see #26