The Mechanics of Energy Contracting for Municipalities