Clean up tests

* Move some tests to separate classes so that they are run in isolated
VMs because of global UniqueNamemanager
* Other cleanup