Dependency Injection pattern implemented with JavaScript.