Mechanisms of deformation and failure in carbon-matrix composites subject to tensile and shear loading