Bug 1014686 - [Messages][Refactoring] Improve "html template string" to "dom node\fragment" conversion. Added Template.prepare method

If I understand your use case, you do want an object that can turn into a string or a fragment. But I don't think you'll ever call toString or toDocumentFragment more than once on the object.  So, for the use case you have, there is not any benefit to caching the returned string or fragment for re-use, right?

I ask because it seems unexpected to me, and a user of this library might hang on to a prepared template after calling toDocumentFragment(), not realizing that by doing so, the string and the template element and its sub-tree are all being kept alive without being garbage collected. 

Its probably a pretty minor risk, but I'd say don't save this stuff unless you really think it is going to improve performance somewhere.