High quality code. Good job!
Template engines allow you to reuse template as functions. I do not believe this system promotes reusable markup. If this is intended for simple static HTML, I would rather use static HTML -- pre-generated using HAML or mustache.
Determine the global object: why not just pass this into your closure function?