An Optimization Approach for Integrating Planning and CO2 Mitigation in the Power and Refinery Sectors