Towards providing Python3 support

I haven't tested that this actually works, but it should. It fixes the imports that changed with python3.