Undo and redo detection

I am now setting the change origin as "undo" and "redo" if we ever need them.

This depends on pull request #61 (and #60 by transition).