Markup branch: generate the Javascript part differently, this time using template directives instead of expressions. This kind of construct (enumeration of dict items) lead me to identify two Markup bugs (#M45 and #M46). If those get fixed, that part of the template could be simplified a bit.