Chemistry of graphite intercalation by nitric acid