Utility function to merge two config objects and use that in merging configs

Change-Id: I795d73132e39bcee15d85c55771ee7e6edab0eb2
Closes-Bug: #1350902