Lithium-cobalt, lithium-poly and lithium-ion batteries can be very unstable even under normal conditions; only the power management chip in your laptop battery stops it from bursting into flames when charging. Some have, even when not charging.
Enormous pressure on battery makers to increase energy density and decrease weight/volume, for phones / laptops / tablets etc. (and now for airplanes!) has resulted in increasingly daring & unstable designs being produced. In aerospace, this is all pretty new tech. The massive electric requirements of the 787 compared to other a/c only compound the problem.
Before the 787, I have never heard of any lithum-tech batteries being used for anything mission-critical in aerospace (please enlighten me if I am wrong).
As a previous poster points out:
Funny, but Toyota sticks with those nickel ones for their Prius.
Yep. Heavy and large by comparison, but well-known, predictable, proven tech.