Smart Battery Management System with Real-Time Estimation of SOC and SOH