A polyfill for query/queryAll