Update index.js

refreshToken function was erroring since self, oauth, regOpts were uninitialized.