common: Encase whole script in anonymous function

No reason not to
Create mwConfig variable as reference point for accessing config values

Individually caching popularly used values is messy not very maintainable
General cleanup
Fixing globals being exposed from closure
Merge remote-tracking branch 'upstream/master'
Merge pull request #1 from Matthew2602/master

General cleanup of common.js