Clean up tests, add flake8 and coverage