Flake8

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