Refactored parse_alert. Added basic serialising support.