Improved support for jsonp callbacks

recreating ticket #202