Many of the bug fixes below are leftovers from OpsSim2.
Bulk of the changes are related to the alarms, their data and the way they are visualized.
There was also a change in the query to fetch the trending data, to simplify the query. This changes has been tested by Luca which has finally proven the consistency between the database data and the root files data.