Lithium-ion batteries in series or parallel