Cosmetic changes to the search page and encapsulation of some javascript