Added some DB maintenance tasks at application startup.

Signed-off-by: pgnunes <pgh.nunes@gmail.com>
Changed applications events sort order to ID "desc" (now showing most
recent events first)

Signed-off-by: pgnunes <pgh.nunes@gmail.com>