Rewrite query timer. Fixed bug 950213.

* Listen to input event rather than trapping for focus and blur. This relieves us from having to poll and compare; instead, the field tells us itself as it changes. The behavior to expect now is that the query fires 300ms after you stop typing. For fast typists, this will result in fewer queries. As a bonus, we no longer have to keep track of the previous query.
* Quicken timer frequency to 300ms for consistency with old behavior. I'd hate for the UI refit to be perceived as less responsive.
* Refactor to remove repetition of min-length test and field trimming. Now doQuery() pulls straight from the DOM. It's called from only one place at the moment, so this is fine. If we want a purer function, we can extract it later from doQuery().
* Armor against out-of-order query responses using a serial number. Without this, you could type "hello", fire queries for "hel" and "hello", but end up looking at the results for "hel" if the responses arrived out of order.