Separate functions for serialization and deserialization from "trie.go".