Reduce the number of roundtrips for DistArray.get_localshapes to zero.

This also adds functions to metadata utils that could be useful for local map construction. But that can wait for another PR.
`return cyclic_size(dim_data)` ?

Please add a test case that runs this branch.