Optimize jQuery.grep on 1.x and add unit tests for the same (#14332)

On ES5 compiant browsers fallback on the native `Array.prototype.filter` method to take advantage of browser level optimizations