Basic implementation of the search.

Still need to output matching incidents and do some re-factoring.