Integration of the Environmental Management Aspect in the Optimization of the Design and Planning of Energy Systems