Refactor to support latest Pydgeot.
Add support for template files in subdirectories.