Factored out search functions in seek_plan.

Updated examples to use new function signatures.