Added undo for node moves. Fixed undo implementation