search: typeahead 0.10 adaptation

* Fixes typeahead in 'Add to search' form.

Signed-off-by: Kamil Neczaj <kamil.neczaj@cern.ch>
Reviewed-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
BibMatch: PEP8 compliance
BibMatch: validation fixes

* Fixes a bug with match validation that may cause records to
  be treated as matched, when it should not match. More
  specifically when matching in the so-called "joker" mode.

* Exposes a new config variable from the matching validation,
  CFG_BIBMATCH_MIN_VALIDATION_COMPARISONS which dictates the
  minimum about of matched fields to actually brand it as an
  equal match.

* Checks for mechanize in regression tests.

* Improve validator record download.

* Previously possible matches were downloaded one-by-one,
  this patch changes this to only make one query to the server.

* Adds more logging points.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
BibMatch: fuzzy queries improvement

* Adds special handling of title, author and identifier fields
  when generating fuzzy queries.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
BibMatch: get_longest_words improvement

* Improves the function get_longeset_words in order to be more
  robust in regards to words in between quotation marks.

* Adds unit-tests appropriate for this function.

Co-authored-by: Kirsten Sachs <kirsten.sachs@cern.ch>
Reported-by: Kirsten Sachs <kirsten.sachs@cern.ch>
Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
BibMatch: more print statements

* Adds some more print statements in match_record function as well
  as skipping empty fuzzy searches.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
BibMatch: New file _cli.py

* Functions relating to the Command Line Interface moved
  out of _engine.py and into the new _cli.py file

* Rebased onto next branch code-structure-with-web-deposit.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
BibMatch renamed to Matcher

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
matcher: Added API and related utils

* API provided as invenio.modules.matcher.api with functions
  defined within (see doc-strings) general summary also provided
  in the header.

* CLI now makes use of match_records() in the API.

* Utils file now provides certain shared functions and bits'n'bobs
  that keep the API clean.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
matcher: Python 3 compatability

* Using six library for cross-python compatability.

* Exceptions included for unimplemented features in
  the CLI.

Co-authored-by: Jan Åge Lavik <jan.age.lavik@cern.ch>
Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
matcher: Review changes, legacy code deletion

* Legacy BibMatch module removed as it's no longer used.

Reported-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Co-authored-by: Jan Åge Lavik <jan.age.lavik@cern.ch>
Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
matcher: API documenation formating for Sphinx

* Reformatted the docstring comments for creating API documentation
  with Sphinx, added API to api.rst

* Minor formatting fixes; including requested changes for merging
  into PU.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>
matcher: Unit tests fixes, new helpers.py

* Unit tests fixed to prevent flask context errors, now using local
  and lazy imports; all Matcher tests passing.

* New helpers.py file added, provides common or separate functions
  for use in unit tests.

* Bugfix for CeleryFeeder skipping last result.

Signed-off-by: Graham R. Armstrong <graham.richard.armstrong@cern.ch>