Pyflakes cleanups

Remove a bunch of unused imports identified by pyflakes.