matrixSlice = (mat, xs, xe, ys, ye) => {
  return mat.slice(xs, xe).map(s => s.slice(ys, ye));
}
2D slice on a matrix.
@param {[[number]]} mat Matrix
@param {int} xs First dimension (row) starting index
@param {int} xe First dimension (row) ending index
@param {int} ys Second dimension (column) starting index
@param {int} ye Second dimension (column) ending index