Add support for display filters to search.js

 - Switched to ids in buildElems, since all search elements have ids now
   - This does require slightly changing things, to avoid breaking MIN/MAX
 - Added more tests