Have the Search field reflect Query changes

This turns the search field into a dynamic template. It's a little messy
because we have to track the search field's focus state and set it back
when we re-render. There's also a small flicker glitch when the focus
blips.