Split the block undoing in two parts and add unit tests.
The first read the undo data from disk and the second does the undo. This ensure we don't depend on the state of the filesystem to undo and makes is easier to unit test. The patch also includes a basic unit test for undo.