Added json encode and decode in the tpl compiler