Yeah, but further down the file (on line 38) there's a bit that's clearly meant to be in a controller. This happens a lot with scratchpad.js (and the jquery tree) too: these singleton objects have these heavyweight components end up being their entire MVC world all in one, and you can't split them out into the pieces you want.

I don't know how to solve it.