Improved trie code
Merge branch 'autotext' into tito