search: move pure alert functions out of graphqlbackend package
Created by: rvantonder
Stacked on https://github.com/sourcegraph/sourcegraph/pull/30274.
As in description. This is a partial move, without dealing with the alertObserver
type yet. I will deal with alertObserver
in the next PR