JavaScript two way data binding and DOM templating