Move apiUtils.js to ES6.
Review Request #8045 — Created March 9, 2016 and submitted
This change renames the file and does a bunch of cleanup. ES6 lets us use nice
things like let/const and arrow functions, and some of this is just
long-overdue cleanup to bring things into a modern style.
Ran js-tests.