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.
It seems a bit more straightforward to let it error out earlier, giving a `KeyError` rather than a `TypeError`, which to my mind is more informative:

```python
stop, start = dim_data['stop'], dim_data['start']
return stop - start
```