Lithium-ion battery management system (BMS)