Move test loader to testinit.js. Fix race condition with dependency loading.
No ticket: link testinit