Add tests for array merging cases to support documentation requested in #167.

This branch is based on my most recent work, but could be re-based to avoid merging
the other branches if desired.