Move templates from script tags to precompiled JS