API Search records and suggestions

Introduced the recording of searches, which then feed into search suggestions

(and FINALLY got everything rebased properly. I'd be sorry about all the PRs that I have created and nuked, but it's late on a Friday :D)