Initial version of a dump.py, ported from previous version.
Needs more work.