Pep8 linting

Add the flake8 env to tox.

Fix up uncontroversial issues reported by flake8.