Everything fixed to make pyflake8 happy.

I've started cleaning up the codebase a bit, and this is the first go.