Microgrids for Fun and Profit Integration of Microgrid Operation and Investment