Moving client JS output creation to internal templating