Combine logic for get/contains to remove some duplication.

More fleshing out of distributed arrays; add some utility functions
(ones, randn).