Switch from cid to id for maintaining undo/redo references. Tests now pass.