Full implementation of Trie