importutils: `lazy_import` function addition

* Adds new function `lazy_import` that uses Wekzeug `import_string` and
  `LocalProxy` for creating lazily importable objects (used in unit
  tests for imports outside application context).
testutils: fix for passing engine to app factory

* Addresses issues with inconsistently set database engine in
  application config since a80bc418.

* Adds new class `InvenioTestCase` that has to by used by _ALL_
  Invenio tests in order to prepare proper application context
  for each test case.  (addresses #1491)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
testutils: fix global imports

* Addresses issue causing errors while running unit tests using
  nosetests or python interpreter from command line.  (closes #1491)

* NOTE do not use global imports that require or might require
  application context in the future (e.g. SQLAlchemy models).
  Alternatively you can use `invenio.importutils.lazy_import` function
  that wraps `string_import` in `LocalProxy` object.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebStyle: fix of youraccount index menu link

* Renames webaccount template to correspond with endpoint name.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
BibFormat: load bfe_elements in Jinja env

* Fix issue with bibreformat creating empty pre-formatted records,
  caused by bibformat elements not being loaded.

Co-authored-by: Jiri Kuncar <jiri.kuncar@cern.ch>
BibFormat: fix app contenxt issue in bibreformat

* Fixes an app context issue in bibreformat CLI program.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
BibDocFile: add download progress callback

* Add an optional progress callback function to download_external_url
  to enable progress reporting of larger files.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebSearch: fix Externalcollection engine property

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
inveniomanage: upgrade manager improvements

* Renames inveniomanage 'upgrader' command to 'upgrade'.
  (addresses #1332)

* Adds functions for easier unit testing of inveniomanage command.

* Moves upgrade script tests to inveniomanage unit tests.

* DEPRECATED: `inveniocfg --upgrade*` commands are replaced by
  `inveniomanage upgrade *`.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebSubmit: removal of foreign key in SbmFIELDDESC

* FIXME improve default and demo data to avoid foreign key problems.
BibRank: relocation of CollectionRnkMETHOD model

* Moves CollectionRnkMETHOD model from WebSearch to BibRank module.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebSearch: fix model __init__ functions

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
installation: renaming of demo site fixtures

* Moves fixtures for populating demo site to separate files.

* FIXME imports of fixtures in Flask tests

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
installation: database populate command addition

* Adds new command `inveniomanage database populate` to fill database
  tables with default data.

* Adds fixtures for filling up fresh installation with default data.

* DEPRECATED use of `tabfill.sql` should be avoided.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>