javascript templating and data binding