Refactoring search application

This refactors a bunch of the search application to pick up
configuration from the HTML page, rather than an included JavaScript
module. This makes it easier to inject settings from the Tornado app
into the JavaScript app, so there's only one place to change
configuration.