Thermodynamic theory and simulation of transport and intercalation of solvated ions in Li ion batteries