Add unit tests for jQuery.grep. Close gh-1345.