Break apart test_frame.py and fix all flake8 warnings
@jreback I re-enabled flake8 checking for unused imports. We should be explicit about what imports are part of a module API (and those warnings explicitly suppressed with `# noqa`) and delete all unused imports. 
