More PEP8ization and added some docstrings

Also, removed (apparently) useless change of self.outtext on line 381
(self.outtext shouldn't be even initialized at that point)