optimized(less function calls) goto-based ArrayQuery class with micro optimizations

Consider using this class only after profiling on your data, works slower with arrays with huge nesting.