First stab at Python 3 support.
More py3k changes.
Please the PEP8 gods.