Flake8 cleanups and add tox config

Jenkins is setup to test this on new pull requests.