Synthesis of functionalized 3D microporous carbon foams for selective CO2 capture