UndoManager: new implementation based on GQueues (almost finished)

TODO
- fix the unit tests (the merging is different)