Add undo/redo for composite and decomposite.

The first implementation of undo/redo.
There has imply issues, because I haven't do a full test.

Change-Id: Ia8a74fa00c360298fa0640892d3d330864690c99