Introduce tuple to store array dimension and shape
minor
Use size() tuple instead of ndims, shape() pointer

- int size() -> int length() (whole element count)
- int *shape -> const tuple &size()
Arrange array allocation to setSize(const tuple &size) function