Move rg4js to external