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

In what we've done so far (see https://github.com/mozilla-b2g/gaia/pull/24259/files#diff-74841e428dea67f7357f1893a4d26155R1596 above), we don't call toDocumentFragment repeatedly, however we have a function that returns the object, because we either use the toString form or the toDocumentFragment form depending on the case. That's the main reason we made it like this. (and also because it looked elegant :) )

When Oleg comes back from his holidays, we'll discuss to improve this like you suggest :)