smurf: Better gap filling

Major re-write to make it simpler, and to avoid replacing short
patches of good inter-gap data as if it was part of the
neighbouring gaps. The old version had problems when lots of short
gaps were being filled, as they were all merged into one big gap
and the filled data was thus very unconstrained (which is not
good for FLT masking).