Pretty major rewrite to switch from ServiceLocator to Dependency Injection. And some simplification too, I hope.