A Flexible Framework for the Examination of Production, Measurement, and Contracts in the Face of Moral Hazard