Add flake8 to Travis build

Changes:
- Added a flake8 code linting step to the travis build, to keep code quality high
- Added a cache folder for pip in the travis build