Compile templates driven by json