Consider http://code.google.com/p/google-jstemplate/
"Simple and robust browser side template processing for Ajax based web applications"
While this isn't a macro processor, it actually solves a related problem of management and separation between data (javascript, json) and presentation (html)
Here are the slides: http://google-jstemplate.googlecode.com/svn/slides/jstemplat...