Logic-ful templating for JavaScript