Added a history service for recording undo and redo steps.