Remove ugly nesting on search.js

Much better.