Add basic unit tests for RSE.
RSE bug fix.

Don't apply RSE to notin selfjoins.