function deepCopyUpdate(objectTree, path, value) {
  if (path.length === 1) {
    objectTree[path[0]] = value
  } else {
    let child = Object.assign({}, objectTree[path[0]])
    deepCopyUpdate(child, path.slice(1), value)
    objectTree[path[0]] = child
  }
}
Updates `objectTree`, which is a tree of nested objects, so that afterwards
`objectTree[path[0]][path[1]][...] === value`. Only the root object is mutated, whereas any
nested objects are copied before updating. This means that once the root object has been
shallow-copied, this function can be used to update it without mutating the previous version.