Adds unwrap utility function

I added an implementation of unwrap() that can operate on general multidimensional arrays, unwrapping along a given dimension. The user can also specify the wrapping range.