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 Arel is a no go, since we're wrapping the columns in `LOWER` SQL functions. I looked into replacing with ILIKE, but SQLite and MySQL don't appear to support it.