Add run_static_analysis

For now, it's just pyflakes on the main codebase
Remove some unused imports and variables