Improving Cooperation in Language Games with Bayesian Inference and the Cognitive Hierarchy