Pyflakes clean

General import cleanup and removal of dead code.

Let us know if the indentation of blank lines is flexible. If not, we'll resubmit.