Modify the functions that return child subnodes and values so they
can also be used to return a list of the intermediate blocks. This
is so we can delete those intermediate blocks (in a later commit).
We also introduce an offset_list structure which is used for collecting
lists of offsets, ie. lists of nodes, values or blocks.
Note that this commit should not change the semantics of the code.