Patch Set 3: Looks good to me, approved; IP review completed

I incorporated all of Shawns comments. I also added more comments for the test cases on Robins request. Now the merge
algorithm looks good from my side.