search: make it possible to test configuration handler
Created by: keegancsmith
There are quite a few changes coming up to configuration handler, so this series of refactors are motivated to make the handler testable. You can review commit by commit.