code: function _buildDependencies(links) {
    var deplist = [];
    // link would be 
    // link1: { parent:[], child:[] }
    _.each(links, function(link) {
      // get the value object that contains parent, child
      var l=_.values(link)[0];
      _.each(l.parent, function(p) {
        _.each(l.child, function(c) {
          deplist.push([c,p]);
        });
      });
    });
    return deplist;
  }
docs: /*
  links would be
  [ { link1: { parent: [..], child: [..] } },
  { link2: { parent: [..], child: [..] } } ]