Homestyx hydra

R1:46abc11114c3

Reduce the number of magic strings in the Ferret implementation

Summary:
Ref T12819. Push more of the magic `' '` stuff into the engine and simplify calls to ngram construction.

Also fixes a bug where a task with title "apple banana" and description "cherry doughnut" could match query "banana cherry" by separating separate term segments with newlines instead of spaces.

Test Plan:
- Indexed some objects.
- Searched (term, substring, quoted terms).
- Viewed index in database.

Reviewers: chad…
Repository: R1 hydra
Commit Date: Sep 5 2017