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.
Hmm, I'm wondering if this might be one of the cases where a .forceToDisk or a .fork might be prudent. Thoughts, @johnynek ?

Also, you could do the map before applying the predicates, since we map them to the exact same thing.