Working IOC container with resolve and register functions