Fixed naming problems and dependency injection for js