Tweaking the exports to play nicely with r.js

When we optimize our client for production we send the relevant js files to r.js (https://github.com/jrburke/r.js) for optimization. Within this environment neither exports nor window are available instead we use this to export.