rewrote merging via dataflow (now faster and more accurate); several refinements of filtering/merging; more tests