Adding missing imports for tests, and gate off others
Removing more unused imports
fix libstd
one last one...