Make mergeable commands (for undo history) overridable.

They were hardcoded and not overridable before.

@nightwing