Some fixes for python3 compatability

Nothing here breaks compatibility with python2, but it would be nice if this package also worked with python3.

This should wait till the cython interfaces code gets merged, because it will need to be updated for that.