This code comes from another project (CATCH)
https://osc.hul.harvard.edu/liblab/proj/catch
I've used this library for templates in js http://handlebarsjs.com/
I did not know you were using another library for the same purpose
The estimated time it would not have time to adapt to the library edx. However, it could do to medium term.