OK. So I opened a pair of feature requests:
Between them they should make this whole area more usable, particularly from the javascript perspective.
Actually, I hope I’m not a prescriptive kind of fellow and @agiletortoise might come up with some other way of moving this forward.