require.js support added via `requirejs` build.sh option

Fixes due to @kangax comments on pull request 808.
- Restored dist/all.js, dist/all.min.js, and dist/all.min.js.gz to
master branch versions.
- Removed "var window;" from test.js
- Revised build.sh to always create dist/all.requirejs.js AMD module.
requirejs build flag additionally makes the dist/all.* files requirejs
compatible.