Single-source formation and assessment of nitrogen-doped graphitic spheres for lithium- and sodium-ion batteries