Flake8 cleanup

Went through and cleaned up a lot of the source. The generated files such as migrations and selenium tests are left uncleaned.