Adds plan rewriting to remove empty Apply

Because of the way Ronja produces plans, Apply is used in
a number of places that are not strictly needed, and where a
simpler plan does the same job. This rewriter finds such plans
and removes Apply from them.