knowledge: API migration to SQLAlchemy

* Replaces run_sql queries with SQLAchemy query.

* Refactors module in order to move logic from api to model.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
I can simply put a print("NOTE: ..your text...") in post_upgrade function?
And in the commit I'll put something like?
```git
knowledge: API migration to SQLAlchemy
    
* Replaces run_sql queries with SQLAchemy query.
    
* Refactors module in order to move logic from api to model.
    
* Fixes bibknowledge webinterface kb mapping update.

* NOTE: ...your text...
    
Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
```