Depinject caching

Turn DependencyInjector into an interface, fix bugs