Reformat tests, add flake8