Recursive merge tool for arrays and objects