[gold] Refactor search function
[gold] Refactor search function

Factor out a function that extracts names/digests from
tryjob results in preparation to add support for
per patchset baselines.

Bug: skia:8341
Change-Id: Ia2e25c33c99a6224b7733a46558e82007f514adc
Reviewed-on: https://skia-review.googlesource.com/148812
Reviewed-by: Stephan Altmueller <43343ec95731c0e8daa7359daf7f2f3935582b24@google.com>
Reviewed-by: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
Commit-Queue: Stephan Altmueller <43343ec95731c0e8daa7359daf7f2f3935582b24@google.com>

google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot