sqlalchmeyutils: fix missing database host port

* Database connections setup via SQLAlchemy did not use
  CFG_DATABASE_PORT, meaning that connections could only be made to
  database hosts running on standard ports.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebStyle: fix stdout redirect for mod_wsgi and shell

* Due to module dependencies webinterface_handler_wsgi is loaded
  even for Invenio CLI commands, meaning that stdout is redirect
  to stderr. This fix moves the redirect from the WSGI handler to the
  WSGI script.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebSearch: add download graph to record blueprint

* Add download graph to template context to match functionality
  of previous Invenio versions.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
InvenioUpgrader: partial fix for SQLAlchemy init

* InvenioUpgrader imports pluginutils which imports webinterface_handler
  which in the end results in an SQLAlchemy model being imported. The model
  then raises an exception due to the SQLAlchemy engine not being initialized.
  This partial fix ensures the engine is initialized by loading
  invenio.flaskshell. However, 'make check-upgrade' will not work for
  non-SQLAlchemy based installations, but will nonetheless report this.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebStyle: use utf8 for jinja2 str to unicode

* Jinja2 requires all strings to be unicode. Invenio however operates with
  UTF8 encoded 8-bit strings. Jinja2 will automatically convert non-unicode
  objects into unicode objects, but using ASCII codec. This function
  replaces the escape function and Markup class in Jinja2, to use
  UTF8 codec instead when converting str objects into unicode objects.

Co-authored-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WebStyle: werkzeug debugger for devel sites

* Enabled Werkzeug debugger if CFG_DEVEL_SITE is greater than 8,
  independently of if an application is running in Apache or in
  a development server.