Linear search.

Experimental branch, not ready for merge.
Reference #1030.