Gravity, surfactants, and instabilities of two-layer shear flows