Implement collapse() (currently a no-op) for all classes that need it. This is part 1 of the foldex-collapse migration, which should hopefully improve compiler speed by moving foldopts into the class itself, where appropriate.