Extract templates out of JavaScript.