Code cleanup

These commits address a series of stylistic issues that don't conform to PEP8. I used both the pep8 and pyflakes tools to identify any issues I missed by eye.