merge: layer collapse feature

So far only tested in serial with all-prism layers.
Topological and geometric robustness
seems to be good. Support for parallel
and pyramids is coded but needs testing.