Generic error handling framework for AJAX calls

This adds two variables to the Discourse global, genericErrorCaught and genericErrorRethrow.

genericErrorRethrow simply calls genericErrorCaught and then chains the promise failure. This is required in cases where you have multiple .then() calls.

genericErrorCaught creates a bootbox popup with either the error message(s) returned by the server or a generic message.

A good 'next goal' would be to have genericErrorCaught also recognize network timeouts and display a different message.

Additionally, 'json' is filled in on all requests to the server, not just GET requests. We already always set the dataType when we want HTML.