search: split _process_term into separate functions
search: split _process_term into separate functions

This is a first step towards turning it into something like a recursive
descent parser.

pvital/patchew,pvital/patchew,pvital/patchew,pvital/patchew