serializeToCharacter function

Serialize a model to a character vector.