Making lithium-ion batteries safer and more reliable