Added DB serialization.

Moved data structures into os_alert.h.

Refactored os_cmd_alert_add into parse_alert so that it can be used for
deserialize.