Generic Javascript templating module