prepend cwd unless test string is an absolute path
generalize to any search string.

Also includes memory usage improvements.