Energy-Optimal and Cooperative Urban Transit Control