Cleaned up Python code (details follow)

PEP8-compliant python (except for the crazy E501 violations going on).
pylint is revealing some bugs but the program still runs fine.
Compressed a few sections of code (not the mega-block though)