Synthesis and characterization of mesoporous and microporous carbons with potential applications as hydrogen storage media