Checkpointing gsm-add-merges tool.

'from' marks can still be out of order.
Checkpointing internal topological sort.