more generic trie codec stuff, adding digit_trie preset template