Tidy up a bunch of warnings, mostly by deleting unused imports.