client and server side DOM based templating