Feature: tools: Use formatted output for resource searching.
This reorganizes the cli_resource_search and do_find_resource functions
into more logical functions. cli_resource_search now just puts together
a list of resources and returns it. This list should not be freed
because it reuses existing lists. Then, there is a formatted output
message to do the actual printing.