Ternary Search Trie implementation for Objective-C