code: function removeNested(elements) {
  
    var ids = groupBy(elements, 'id');
  
    return filter(elements, function(element) {
      while ((element = element.parent)) {
  
        // parent in selection
        if (ids[element.id]) {
          return false;
        }
      }
  
      return true;
    });
  }
docs: Return a filtered list of elements that do not contain
  those nested into others.
  
  @param  {Array<djs.model.Base>} elements
  
  @return {Array<djs.model.Base>} filtered