remove unused imports, standardise import order, etc
fix tests
remove unused parameter per hugo
Merge pull request #1212 from ContinuumIO/task/flakes

remove unused imports, standardise import order, etc