Template registry

@dominicc, PTAL?