function interpretAxis(axis, dim) {
	  while (axis < 0) {
	    axis += dim;
	  }

	  return axis;
	}
Interpretable potentially negative axis index.

For example, given axis = -1, and dim = 3, this function will return 2.

@param axis The axis index, may be a positive, zero or negative integer.
@param dim Total number of dimensions, a positive integer.
@returns A non-negative axis index equivalent to the input `axis`.