Edit in JSFiddle

// Example Object
var objectData = {
    id: 'plant',
    content: [
        {
            id: 'veggie',
            content: []
        },{
            id: 'fruit',
            content: [
               {
                    id: 'apple',
                    content: []
                }
            ]
        }
    ]
};

var map = {};

// All this does is write out to the UI instead of doing a console.log
function writeOutput () {
    var container = $('<pre></pre>');
    $(Array.prototype.slice.call(arguments)).each(function (i, v) {
        container.append(JSON.stringify(v, null, 2) + ' ');
    });
    
    container.appendTo('#output');
    $('<hr/>').appendTo('#output');
}

// Flatt maps the objects
function mapObject(object) {    
    this[object.id] = object;
    
    object.content.forEach(function(value) {
        mapObject.bind(map)(value);
    });
}

mapObject.bind(map)(objectData);

writeOutput('Original Object: ', objectData);
writeOutput('Original Map: ', map);

function insertNew (target, id) {
    var newObj = {
        id: id,
        content: []
    };
    
    map[target].content.push(newObj);
    map[id] = newObj;
}
writeOutput('Insert \'tomato\' into \'fruit\'');

insertNew('fruit', 'tomato');

writeOutput('After Insert Object: ', objectData);
writeOutput('After Insert Map: ', map);

function moveObject(id, parent, target) {
    var parent = map[parent],
        obj = map[id],
        index = parent.content.indexOf(obj);
    
    map[target].content.push(map[id]);
    parent.content.splice(index, 1);
}

writeOutput('Moving \'fruit\' from \'plant\' to \'veggie\'');

moveObject('fruit', 'plant', 'veggie');

writeOutput('After Move Object: ', objectData);
writeOutput('After Move Map: ', map);