Trie: Make the value_to_path function into a member that can be set with a constructor argument