Cleaned up the code to conform much more closely to PEP8 (fixes #60).