More improvements to the 3-way merge.  Additional test cases added.