Moved history management to HistoryManager; implemented redo functionality