code: function prepareTasks (allTasks, support) {
      const tasks = {before: {}, after: {}};
      let i;
  
      for (i = allTasks.length - 1; i >= 0; i--) {
          const task = allTasks[i];
  
          //browser compatibility
          if (!needFix(support, task, 'forBrowsersLowerThan')) {
              continue;
          }
  
          if (!needFix(support, task, 'forBrowsersUpperOrEqualTo')) {
              continue;
          }
  
          //Get type and name
          let types, names;
  
          if (typeof task.filter === 'string') {
              types = [task.filter];
              names = ['_'];
          } else {
              types = (task.filter.type instanceof Array ? task.filter.type : (task.filter.type ? [task.filter.type] : ['_']));
              names = (task.filter.name instanceof Array ? task.filter.name : (task.filter.name ? [task.filter.name] : ['_']));
          }
  
          types.forEach(function (type) {
              if (!tasks[task.position].hasOwnProperty(type)) {
                  tasks[task.position][type] = {};
              }
  
              names.forEach(function (name) {
                  if (!tasks[task.position][type].hasOwnProperty(name)) {
                      tasks[task.position][type][name] = [];
                  }
  
                  tasks[task.position][type][name].push(task);
              });
          });
      }
  
      return tasks;
  }
docs: filter and sort the tasks to improve performance (position.type.name)