Expand plan refactoring

Yes, we need it. We will make it work. If we drop this, Ronja cannot express var length expand anymore.