Python3fixes

Hi, just looking at getting some python 3 compatibility together if you are interested. I don't think I have exercised all of the code yet so I wouldn't be surprised if there is more work to be done.