code: function removeAttached(elements) {
  
    var ids = groupBy(elements, 'id');
  
    return filter(elements, function(element) {
      while (element) {
  
        // host in selection
        if (element.host && ids[element.host.id]) {
          return false;
        }
  
        element = element.parent;
      }
  
      return true;
    });
  }
docs: Return a filtered list of elements that do not
  contain attached elements with hosts being part
  of the selection.
  
  @param  {Array<djs.model.Base>} elements
  
  @return {Array<djs.model.Base>} filtered