Chitosan as a sustainable precursor for nitrogen-containing carbon nanomaterials: synthesis and uses