Basic implementation of the Ternary Search Trie