Make sure code is in and stays in compliance with PEP8.

PEP8: python style guidelines.
I've added a test: tests/pep8/test_code_format.py that goes through all
the directories and uses the pep8 module to test them for compliance.
If any new directories are added I'll need to add a new test.
All code (apart from experiments) passes at the moment and the test
should make it easy to keep things that way. Error E501 - line length
too long - has been ignored.