Test and refactor Event#search.

Test and refactor SQL search engine implementation of Event#search. This lays the groundwork for eventual object extraction.
Hmm, looks like we could drop down to the Arel level and do ORs there, which might clean this mess up... might be out of scope for this PR, though. I dunno.