Bug 853788 - [SMS] support the "full name search" use case r=julienw

- Bug 853788 - [SMS] support the "full name search" use case …  05c0217
- Make multi-term searches match on both fields. Fixes display of match… …  db02b1c
- Add clarification of contact match validation. Set handlers to null (… …  870b7b6
- Change contact lookup and filter strategy …   037bd66
- Finalize Validation and Lookup strategies …   6a6b441
- Fix early bailouts on missing inbound filterValues. Update Lookup Str… …  578cfba
- Clarifies bailout strategy for avoiding known errors …  e1d70b7
- Failing tests: multi-term lookups where predominate term is the first… …  142c5cf
- Fixes: multi-term lookups where predominate term is the first in the … …  49c3938
- gjslint line length nits …  5ed2251
- Devolve the isMatch implementation …  99bf4eb
- Prevent duplicates appearing as a result of fast-typing. Reduces list… …  4ba9a8a
- Modify MockContact to accept explicit givenName, familyName; Modify M… …  41abe0a
- Update MockMozContacts.find to support multi-term search result mocks …   d0cba06
- Update multi-term search validation and matching tests …  d35624e
- Always remove the previously existing results. …  d3804b0
- Don't expose isMatch on the Contacts object

Bailout Strategy
1. A _missing_ filter.filterValue will results in an
   error when passed to mozContacts.find, bailing out
   early avoids the additional overhead of making a
   request that we know will fail.
2. Missing navigator.mozContacts API or empty but
   present filter.filterValue make the app useless,
   so prevent unpredictable state by making the
   result a no-op.

Validation Strategy
1. Let _found_ be a register of confirmed terms
2. Let _contact_ be a contact record.
3. For each _term_ [...input list], with the label _outer_
 - For each _field_ of [givenName, familyName]
   - For each _value_ in _contact_[ _field_ ]
     - Let _found_[ _term_ ] be the result of calling
         _value_.startsWith( _term_ )
       - If _found_[ _term_ ] is **true**, continue to
         loop labelled _outer_
4. If every value of _key_ in _found_ is **true** return **true**,
  else return **false**

Lookup Strategy
1. If only 1 term, set filterValue to that term.
2. If more than 1 term, find the length predominate term.
3. If filterValue.length is < 3, set the filterLimit to 10
4. Remove the length predominate term from the list of validation terms
5. Make a mozContact.find request with the length predominate term
   as the filter.filterValue.
6. In the mozContacts.find request success handler, filter the
   results by evaluating each contact record against
   the list of validation terms.

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Merge pull request #8830 from rwldrn/853788

Bug 853788 - [SMS] support the "full name search" use case r=julienw