Improved the code to remove redundant baselines. It now accounts for possibility the two baselines have exactly the same revisions. It is also a bit more efficient, only visiting each pair of events once.