Use dimension information passed from mengine to determine array depth when reshaping multi-dim arrays.
Fixes #37