Appease the pep8 and pylint gods

Remove unused imports, add spaces, other stuff.