Refactor JD_BEGIN .. JD_END into JD_SCOPE.