Fix pep8 errors and warnings
Further pep8/flakes fixes
Run flake8 as part of the Travis build

In order to ensure code consistency and quality, run the full flake8
linter on the codebase. This includes everything from pep8, pyflakes and
the mccabe complexity tester.

I've put it in `script` rather than `before_script` because I'm a
bastard and think quality regressions should fail the build. Currently,
the codebase is clean.