Moved the search page JS out of the HTML template. Further modularised the search form. (JIRA 89)