code: function(id) {
      // get embed keys as a separate array to enable deleting keys in map
      var ids = Object.keys(embeds);
      for(var i = 0; i < ids.length; ++i) {
        var next = ids[i];
        if(next in embeds && _isObject(embeds[next].parent) &&
          embeds[next].parent['@id'] === id) {
          delete embeds[next];
          removeDependents(next);
        }
      }
    }
docs: recursively remove dependent dangling embeds