Fixed issue in redo- and undo history handler, where the committed
commands where increasing (unnecessarily) in composition over time.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>