Fix JSONP glitch for query errors, clean up _sendJsonp utility

Previously we've only used XHR for queries unless it wasn't available, and JSONP errors were handled incorrectly. This patch cleans up error handling and improves reliability of JSONP requests.