MDL-43089 move JS initialisation into the renderer.