Heteroatom doped porous carbon for alternative energy conversion and storage systems