Handle 2D arrays in serialization

Fixes #61