Add flake8 check, resolve violations and travis scripts for CI