Renamed pep8 test to code formatting test
Changed PEP8 test to flake8 test.

Also no longer depends on matplotlib.
Adapted setup.py
Refactoring
Removing duplicate test.
Many small changes so that the codebase adheres to flake8.

Mainly removing duplicate imports or unused imports.
Travis now uses flake8
Merging with master
Merge pull request #644 from krischer/flake8_tests

Flake8 tests