Extracted merging of adjacent children into a mixin so that we can share the code between the Folio and IdmlStory parsers.