Flake8

Fixes flake8 errors in the codebase and adds a travis task to run flake8 on the codebase.