Avalanches and deformation in glasses and disordered systems