Massive pep8/pyflakes cleanup

The pyflakes and pep8 checks should now run automatically when Travis CI builds run. I've documented which flags are ignored in .travis.yml (e.g. line length checks).
Annoying, but you could run flake8 twice, once for most files and once for this particular setting.