Templating and binding javascript library