fix flake8 issues and add tox.ini for flake