Add support for serializing arrays.