various pep-8 cleanups; remove unsused imports; remove unused variables

A number of PEP-8 related cleanups. Also removing unused imports and unused variables.
-1 to this change, makes it far less readable