Fixes to `utils.testing` import functions

- Added `utils.compat` with helper functions
  for proper type checking
- Simplified many type checks throughout the code
- Documentation changes to test import functions