Merge document utilities seem to be in disarray. Would be nice to update them and write some proper tests for them.
See here