Distinct modules of immunity provide resistance and tolerance to fungi