Change of get_events and get_traits method in MongoDB and Hbase

This redesigns get_events method to generator style, with some additional
changes in unit tests and api.v2
get_traits method is also improved in this patch, additional sorting was
removed from get_traits method.

Closes-bug: #1339626
Change-Id: Ie65cc6f6c85eab53847176273b27de693bd2052f