Tree templates

This pull request generalizes Quill's project element template code, providing a better foundation for the future and opening the way for element templates.  It also adds the 'quill add' command.