Repair some stupid mistakes in reference PSD cache
Track API change in lalsimulation
Break ties when two PSDs match

Also add some code comments.