Test and refactor Event#search.

Test and refactor SQL search engine implementation of Event#search. This lays the groundwork for eventual object extraction.