ENH: Refactored merge details to within _merge.

This commit moves the functionality of core modules made in previous
commits to within the merge module itself.