Electrons, protons, and solvents in carbon nanotubes