knowledge: API migration to SQLAlchemy

* Replaces run_sql queries with SQLAlchemy query.

* Refactors module in order to move logic from api to model.

* Fixes bibknowledge webinterface kb mapping update.

* NOTE If you are running Invenio 1 and Invenio 2 on top of
  the same database, please use only Invenio 2 knowledge base
  administration interface from now on, in order to ensure
  data consistency.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
groups: user selection by autocomplete

* Implements a reusable RemoteAutocompleteField.

* Implements a Jasmine testsuite.

* Improves user selection with the autocomplete field.

* Improves group selection with the autocomplete field.
  (addresses #1788)

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
deposit: js uploader component

* Adds flightjs uploader component with support for pluggable
  uploader engines such as PLUpload and DropBox.

* NOTE RequireJS path to FlightJS was changed from vendors/flight/lib
  to vendors/flight. Scripts defining flight components MUST update
  their require statement from require('flight/lib/component') to
  require('flight/component').

Reviewed-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Signed-off-by: Adrian Pawel Baran <adrian.pawel.baran@cern.ch>
deposit: InvalidDepositionType handling

* Handles the InvalidDepositionType exception being raised when
  trying to initialize a deposition type on older submissions which
  is disabled via the DEPOSITION_TYPES config variable.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
workflows: Holding Pen previous/next robustness

* Makes the previous/next object getter more robust.

* Adds unit tests for this functionality.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
workflows: aborting and skipping

* Adds support in the workflow engine for aborting execution and
  skipping objects using new functions `eng.skipToken()` and
  `eng.abortProcessing()` that will not save the workflow object.
  Useful in complex workflow where for example the workflow object
  is deleted as a final step in a task before aborting/skipping.

* Removes legacy DEBUG flag from engine as logging is anyway logged
  with the debug loglevel.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>