append template to doc BEFORE processing, leads to much better dojo integration and page loading. whew.