Slicing and boolean indexing in multidimensional arrays

On master, if IndexStyle(A) === IndexLinear(), Base.to_indices always transforms the last logical index into Base.LogicalIndex{Int}. Thus T[:,j] behaves as T[:,findall(vec(j))], which is always not correct.
The above change avoids the wrong optimization by adding a dimension check. I’ve open a PR to fix this.