JS: remove unused variables.
Tweak uglify's options.

Enable warnings for the core JS and explicitly set the main options.
Run `grunt dist`.