ROOTR: fixed TRInternalFunction to support new Rcpp version and add EventLoop for R's graphics system.