Separate stable and beta search JS code

Use a global search-results event rather than a write-results event of a
SearchOverlay.

Change-Id: Ia8d61ffcc4e4eb936380c5cd1493a3070f2131b4