MAINT: some cleanups in tests of several modules

Mainly removing unused code, imports, changing test docstrings to comments or removing them.