Add core dump viewer. Refs #166.

Also tidy up dumping code. We can use a plain object instead of SafeMap
since refs are always numbers, never reserved words.