Rewrite the X509->alert mapping code