I'm glad to see setContextMenu factored up. :-) But it seems like a pretty leaky abstraction: the spec is basically "Pass me an object containing everything the template needs to render, the entire character of which changes based on `folder`. That means, to use it, I have to go understand the template, then work backward from that to figure out what setContextMenu wants. Maybe setContextMenu could take simply an array of menu items--an href, label, and class for each. Then it would do one thing--draw a menu--and we could figure out the contents separately.