MAINT: Move offset calculations into special function

Also adds a test to check offset calculation is correct when
setting strides for a base array with negative strides.