refactor to take the focus from individual indexes to 'search' process

Refactored some code to allow for multiple 'searches' to be configured and use them by name rather than individual indexes. Also wrote some tests.