NEW: Allow specifying custom factories for services.

If you specify a `factory` key with a service definition, a service
with that name will be used to create instances of the service.

The factory should implement the `InjectorFactory` interface.