Add flake8 linting, make stylistic adjustments so it passes