code: function nestedApply(obj, path, fun) {
  	if (path.length === 0) {
  		const _ret = fun(obj);
  		return {
  			ret: _ret,
  			newObj: obj
  		};
  	}
  	// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
  	let newObj = obj;
  	const last = path.pop();
  	for (const elem of path) {
  		if (!newObj[elem])
  			newObj[elem] = {};
  		newObj = newObj[elem];
  	}
  	const ret = fun(newObj[last]);
  	return {
  		ret,
  		newObj
  	};
  }
docs: Abstracted version of http://stackoverflow.com/a/18937118. Note: this _does not work_ with nested set