Mechanism for electrochemical hydrogen insertion in carbonaceous materials