Expressive templates for generating JSON