First part of #57 implementation: serialization of simple arrays