Add DRYing to socket handler; fix incident query filters.
Add incident query tests
Abstract object comparison function.