Operate in memory threshold

Uses psutils (optionally) or a simple conservative 1 GB threshold for the cube size before deciding to loop over 1D slices.

WIP: needs at least one more commit