Implementation of merge-with in JS. Merge an obj with n number of obj running a function on matching keys.