Test consistency with baseline aggregations

Big one.
Includes many fixes dealing with new data, as well as fixes revealed by making sure that running the new pipeline on old data gives the equivalent of running the (fixed) old pipeline on old data.