Remove dead Py2.2 code and fix a bunch of PEP8 formatting