Structural, chemical and electronic differences between bare and nitrogen-doped carbon nanoparticles