PEP8

Make the codebase PEP8 compliant and improve code quality in general.

Metrics
=====
pep8.py
----------
Passes pep8.py with no ignores! Less some false positive bugs in pep8.py and ignoring parsetab.py etc.

PyLint
--------
Ran Pylint on the codebase before and after this PR. The [results](http://pastebin.com/iuMJghUW) show that the pylint score has increased for every file. Average score increased from 1.92 to 3.48.

PyFlakes
-------------
212 warnings reduced to 21  warnings.