Stanford scientists have engineered a smart battery that can detect fires before they happen