PEP8 and pyflakes changes

I ran PEP8 and pyflakes over some of our source files in an attempt to start cleaning up our code.