Adds support for replacer in json/jsonp calls

See #2097