Python 3 modifications

I only now saw you've abandoned this project. I almost got through the transition to Python 3 but it now seems a waste of time to continue. However, these changes might be of use to someone else. 

Cheers,
Morten