Added JSON support for tmpl file.
Server-side tmpl loader api changed.