Create midpoint-search.js

Painfully ugly and still too tightly coupled to UI.