Could we use smarty as a templating engine for this? I know that you are planning on using templates in the whole of Moodle and Smarty is already included in Moodle distributions. The data module really seems like a good start for it.
I have some code here which passes texts out of the database to the Smarty engine and displays it. It's of no use because I do not yet have code which passes variables to the Smarty template (and a template without fields to fill in is er... useless) but it enables me to use some of the functions that are included in Smarty (like the zebra stripes someone was asking for... popups made with overlib , etc...)
Forgive me if this doesn't make sense, I just started discovering what this Smarty is all about. Another advantage to me seems that caching is already built in and easily configurable.