Improve TypedSimilarity algorithm and update test.

Add one optimization to disco/dimsum algorithms: doing the filtering before the large self-join.
Update test to use TypedTsv.
I can do the map first before creating two pipes using the predicates and add a .forceToDisk there. Is that more recommend?