This is a cleanup attempt to remove unused module imports. Changes in some files also include logical grouping and alphabetical sorting of imports.
merged