Fix r2.js to be used from duktape