* Refactor a bit the code so that the refactoring jobs are not aware of nested documents but of nested spaces. * Add unit tests