Trim dead code
Attempt to PEP8 some stuff.