Mechanics of deformation and failure in rechargeable battery materials