Serialize and deserialize thesaurus