This moves the current merge analysis code into a more generic version that can work against any reference. Also change the tests to check returned analysis values exactly.