extend and merge objects, deep or shallow, in javascript