Morphology and pore control in carbon materials via templating