fixed all pep8 and pyflakes errors and put pep8 and flakes check in CI