Most of these module-global state variables moved into SearchModel. The net result is more or less the same, but it makes it clearer what state is part of the search and results vs. the view, making the separation of concerns clearer.