Structure, chemical bonding and electrochemical behavior of heteroatom-substituted carbons prepared by arc discharge and chemical vapor deposition