Optimized trie to use slices instead of maps.