Add support for custom templates in subdirectories

- Includes tests for templates and their application
Add release-structured compiling tests
update plugin install code