Add autodetection for JSONP for remote urls

Compares the current location with the remote url to determine whether
JSONP is required to communicate and sets the appropriate dataType for
the $.ajax request