Refactoring Util.deep_merge to handle arrays and hashes