[composer] Fix missing undo command for editing legend items, other small fixes for legend undoing