Add initial hash join planning support
Refactor CardinalityEstimator

Instead of having multiple methods for different kinds of entities
to estimate, make it simply take a logical plan.
In particular, that makes writing tests for planning considerably
easier by just spelling out a partial function that returns
different estimates for different plan patterns.
Use toSet in MatchTest to make the result order-independent
Remove dead code
Merge pull request #2168 from jakub-/hash-join

Add initial hash join planning support