It's a shame that it'…

It's a shame that it's not possible to easily reference functions in a file, and make them first class.

render(json, renderFunction) or even put view=renderFunction in the JSON

then a blob of json in script tag of a head self renders, and so do all the widgets