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.
This function, just choose the correct function and returns it. It doesn't return the result. I'll add an explict test case, but it looks like coveralls sees it as tested [here](https://coveralls.io/files/217539490#L252)