Move template rendering extension method to Templates.kt