You could turn this into a loader plugin, similar to how the tmpl plugin works in the email app. The email app uses a tmpl_builder.js which is just the same as the text_builder.js in clock, but has a modified write: function for writing out the inlined output to use the tmpl module.

That way, the panel modules just need one dependency, a template! one, instead of needing to require template and a text! resource, and better encapsulates the template construction.

Not strictly needed, just giving some options.