Tests for #107

Fixed several bugs in the new array classes, and implemented some
rudimentary functional and unit test for them.