JavaScript Dependency Injection