The Development Of A Battery Management System With Special Focus On Capacity Estimation And Thermal Management