Make resolve mergableWithSource, a boolean returning function.

Add comments for maybeCollapse and maybeSplit