Massive rework of multipolygon assembly algorithm.

Instead of doing everything in one go, this now first assembles the rings, then
finds out which are inner/outer, then finds the outer to each inner. This is
much easier and actually works...