Python 3 compatibility

I've cleaned up a few things that were causing grief while trying to install this in Python 3 land.