SubArrays: efficient linear indexing for appropriate types

This incorporates important innovations of ArrayViews