Add a function to collect a list of all words in a given trie.