Would it be better to have undo / redo added to the history at the same time? Unless I'm mistaken if you mess up the order of the functions when changing history you'd get odd results. Even just adding a wrapper function around the two would be good so someone doesn't try setting the redo before undo.