Asynchronous dependency injection using Q promises