Refactor RSE code slightly.
Improve semijoin RSE code to recognize implied semijoins.

That is, suppose we have a rule:

    r1 <= (t1 * t2).pairs(:x => :y) {|a,b| [b.y]}.notin(t3)

Although the tlist of the join only references t2, we know that t2.y is
equivalent to t1.x (by the join predicate); hence when we see t3(Z), we can
reclaim both t1.x=Z and t2.y=Z.
Fix bug in RSE for implied semijoins.