To simplify things we should put pure method class and other code in templates. I believe that mako templates is good if not the best.
This will simplify change of modes and implementation. It will also make the syntax-hl work for the JavaScript we use.
And it's useful in any web application so it's not that bad for a dependency.
//Samuel Ytterbrink