Add repository dump code.

It needs improvement, but at least it is checked in.