Added support for specifying the language in the optional options object when serializing.