(#1438) - Migrate basics tests to chai and fix setup / teardown

Ready for Review, I want to migrate all the tests to this but I dont think we need to wait to do them all at once

My main motivation is debugging initialisation error (#1438), I want the tests to be using the code exactly how its expected to be run and not using helper functions to be doing setup, I also wnat to stop using randomly generated database names (that was a hack when we used to want to run the tests in parallel against a single server)

I moved dbs / testHelpers into a different scope just to make it clear what scope it lives in, I have had problems with having top level vars being clobbered by other test files in the browser before