Cooperating in the face of uncertainty: A consistent framework for understanding the evolution of cooperation