PEP8 compatibility changes

I used the [pep8](http://pypi.python.org/pypi/pep8/1.4.1) package to make some style changes to the code to make it easier to read and comprehend. I tried to split up my commits in case you did not want to include all of them (e.g. if you want to continue using tabs instead of spaces).