Revert "Split template_name into dirname and basename."

This reverts commit 962754eeec206b520bc3dfcc50b267a4ea43d880.