Issue #1089300 by nod_, mfer, JohnAlbin, ksenzee: Clean up drupal.js.

PR for https://drupal.org/node/1089300