The original version has been reworked and expanded with coauthors. The new version has 30 pages; it will appear in the Proceedings of the London Mathematical Society
Extensions of Lie-Rinehart algebras and cotangent bundle reduction