Added a function to return an instance of a registered class from the IoC Container.