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