Simplifying things to search.js

As I said on the commit, the purpose of this PR is to get things simpler on search.js.

If you think that the first commit is unnecessary and it's not fair to merge with its existance, just let me know that I make a third PR, with a clean/new fork.
is an array lookup really simpler than the previous code ?

Btw, I already see 1 drawback to be aware of: it breaks the JS on IE8 (even though I doubt that IE8 has lots of page views given that Packagist is targetting developers)