Javascript and templates foundation