db_ido: Refactor historical comments/downtimes.

fixes #4740