Serialization for n dimensional arrays. Fixes #47

This could use a little more testing before we tag a new version, but I think it's sound. At the very least it will be faster than the old 2 dimensional serialization code :)