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.
For now, keeping it `Distribution.get_localshapes()` is fine, the `get_` prefix doesn't imply communication, just that it's a getter.  We might make it into a `localshapes` property down the line, but since there's some non-trivial logic going on here, I'd prefer the `get_localshapes()` name.