Real-time Optimal Battery Thermal Management System Controller for Electric and Plug-in Hybrid Electric Vehicles