Removed unused imports and did some minor pep8 cleanup.

Maybe sometime  I can do something a bit more useful :)