Add support for dump().

I use dump() a lot for ad hoc profiling in the browser. This patch adds
a TypeScript declaration and a shell definition.