make the search box work even when opened from the filesystem

The search box only used to work when the index page was opened via HTTP,
because it had to retrieve search data via AJAX. Doing this from the filesystem
is disallowed in browsers because of security reasons. This change puts
the search data directly into the index page, so that no additional request
for them is needed.