Clean up whitespace and remove unused imports

Was browsing this file, thought I'd clean up some of the PEP 8 warnings and remove a few unused imports.