[Mongodb] Implement events on Mongodb and DB2

In this change events are written into database (Mongodb, DB2) and
retrieved from it.

Several methods were implemented for this purpose:
1. record_events --- store events into database
2. get_events, get_event_types, get_trait_types and get_traits --- get data
from db.
Add some attendant changes.

Implements: blueprint mongodb-events-feature
Change-Id: I8a525e5bf307efcc894f581e4de12094a39343e4
Merge "[Mongodb] Implement events on Mongodb and DB2"