Modified Trie to use a treemap.

TreeMap based tries will use much less memory than ones based on
hashmaps; this should prevent overrunning machine memory.