Fix PEP8 errors and warnings, run flake8 during CI