mw.loader: Update addScript() to match latest jQuery

* Optimise for modern browsers by using the quick document.head
  when available.
* Fallback to documentElement (<html>) instead of <body>.
* Prepend instead of append, per upstream jQuery.

Change-Id: I00ddceea531114704a3aa64961dec90181315c19