Add flake8; fix flake8 errors.