add a set method to object registry

This is primarily to make testing easier. Otherwise it's very difficult
to inject a mocked object into a registry