Revised version of http://ejohn.org/blog/javascript-micro-templating/