Switch to jsonp and refactor js in dummy page