Refactor out search.json so that the json and html parts are separated