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.
Merge pull request #1591 from nnethercote/add-dump

Add support for dump().