extend and merge objects, deep or shallow