Pyflakes clean

Cleans up unused imports, and a bit of dead code.