Making fomatto play nicely with r.js

Neither window or exports is available in the r.js optimization processing, so set pointers to this instead.