Added generic version of Trie using gengen.