Check QA: add flake8 to tox/travis

Also fix any current issues (except for the one from PR #152).