[2.2] Better plans for patterns with cycles in Ronja

These changes tries to produce better for patterns with 
cycles, by allowing multiple leaf-nodes for the same 
identifier to be used.