CSV export working for simple cases

Checkpoint.  Only internals are written so far, not UI.  Complex cases
not dealt with yet.