The automaker will replace battery modules and install software that identifies potentially dangerous anomalies or damaged batteries.