Add a general `view` method for DistArrays

Closes #246.