tweaks DI interface to allow only a few optional params to be set

also includes quick and dirty changes to the tests to show mocking
working.