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>
Ok, I modified the model:
```diff
diff --git a/invenio/modules/knowledge/models.py b/invenio/modules/knowledge/models.py
index 7517833..e7e088b 100644
--- a/invenio/modules/knowledge/models.py
+++ b/invenio/modules/knowledge/models.py
@@ -127,13 +127,11 @@ class KnwKBRVAL(db.Model):
     """Represent a KnwKBRVAL record."""
 
     __tablename__ = 'knwKBRVAL'
-    id = db.Column(db.MediumInteger(8, unsigned=True), nullable=False,
-                   primary_key=True, autoincrement=True)
-    m_key = db.Column(db.String(255), nullable=False, server_default='',
-                      index=True)
+    m_key = db.Column(db.String(255), nullable=False, primary_key=True)
     m_value = db.Column(db.Text(30), nullable=False, index=True)
     id_knwKB = db.Column(db.MediumInteger(8), db.ForeignKey(KnwKB.id),
-                         nullable=False, server_default='0')
+                         nullable=False, server_default='0',
+                         primary_key=True)
     kb = db.relationship(
         KnwKB,
         backref=db.backref(
```
And I put:
```python
db.session.query(models.KnwKBRVAL).join(models.KnwKB) \                      
         .filter(models.KnwKB.name == kb_name,                                    
                  models.KnwKBRVAL.m_key == old_key) \                             
         .update({"m_key": key, "m_value": value})
```