Fix a bunch of flake8 things

Fixes
- A bunch of unused imports
- A bunch of cases where variables were being assigned but not used
someone is going to look at this code and wonder "wtf"... `flake8` really should have figured out a more explicit tag