Initial RSE rule optimizer.

Rewrite rules to avoid obvious redundancies. For example, if we have:

    r1 <= r2
    r3 <- r1

We can replace this with

    r3 <- r2

And delete r2 along with the first rule above.
Tweak test cases.