Remove unused imports

I removed most unused imports all over the place.

I didn't do this when the import is clearly just putting things into API namespaces, particularly in a lot of `__init__.py` files. It would make sense to be more explicit about that by using `__all__` in those cases, but I haven't done that here.