phase-list: expose zipMerge via public API
zip-merge: rework the impl. using toposort

Replace a hand-written algorithm with a simpler solution based
on topological sort.