Done TODOs
Reverse logic of KEEP_ON_ERROR
Introduce a shortcut when there are no branches to weave, rather than recalculating the whole merge map
Added explanatory comments and TODO