pep8 and pyflakes cleanup

There's a bunch of red all over the codebase and it's making me sad.