Remove most unused import statements

The flake8 tool reported a lot of import statements where modules being
imported were never actually being used. After some basic checking,
these appear to be import statements that can be safely removed.