ajax_modal, handle network failure

If the server is down completely when the ajax request is made, previous to this you'd get weird behavior (grey overlay, no actual modal). 

We add a catch for this, and display an error message. No good way to do i18n in BL javascript at present, but I made the failure function a separate function easily locally over-rideable, so local app can do something different/better (different message, different behavior than just displaying a message, whatever).