Add encoder and decoder for identifiers.

Improve quotation code of Array encoder.

Refactor Array encoder and decoder functions to allow reuse for
identifiers.