Refactor search_autocomplete_source

Hi guys, been a while!

Supposedly this method had the most complexity in the project, and it
didn't have test coverage, to boot. So I've tried to correct that.

Also covers simple_sanitize which didn't have specs, since
search_autocomplete_source makes use of that method.