preload() function. Inject dependencies into a constructor

usage in the tests. open to suggestions on a new name for this as inject is already taken...
more than happy to add some more tests if this is approved.