Fix the search field

Set and get the input's value via .val().
Show the main page when coming back from a search

When the search field has less than two letters, show the index
page. The reverse effect is already here, but switching from search
into main listing was missing.