Moved the merge function into the Iterables class.