Email Record: From an Ontology for Programming to a Type-Safe Template Language