Standardise the merge logic
Issue #1320
new
This is a follow-up of pull request #754 review (an inline comment).
There are at least 3 points where the merge can occur: lib-merge, tikal and rainbow-kit. So, it would be nice to consolidate all related code into one place.