Don't set all injector instances to the global instance.
FIX: Only unregister the relevant class when adding an extension.

This fixes an issue where the Config instance could not be injected, as
it would be immediately cleared.
NEW: Allow specifying a factory to use for creating services.

A service factory can be used for creating instances where a non-trivial
construction process is required. This is done by adding a `factory`
key to the service definition.
Register config as a service.
Merge pull request #2700 from ajshort/injector-factory

Injector Factory