Slightly refactor and ES6-ify the code in `ObjectLoader`
Slightly refactor and ES6-ify the code in `ObjectLoader`

This patch changes all `var` to `let`, and caches the array lengths in all loops. Also removes two unnecessary temporary variable assignments.

websirnik/pdf.js,mainegreen/pdf.js,mozilla/pdf.js,skalnik/pdf.js,xavier114fch/pdf.js,macroplant/pdf.js,websirnik/pdf.js,Snuffleupagus/pdf.js,Snuffleupagus/pdf.js,nawawi/pdf.js,Shoobx/pdf.js,caremerge/pdf.js,Rob--W/pdf.js,nawawi/pdf.js,xavier114fch/pdf.js,adlerweb/pdf.js-Touch,showpad/mozilla-pdf.js,mozilla/pdf.js,adlerweb/pdf.js-Touch,timvandermeij/pdf.js,skalnik/pdf.js,caremerge/pdf.js,showpad/mozilla-pdf.js,mukulmishra18/pdf.js,Rob--W/pdf.js,Snuffleupagus/pdf.js,timvandermeij/pdf.js,Shoobx/pdf.js,showpad/mozilla-pdf.js,macroplant/pdf.js,Shoobx/pdf.js,macroplant/pdf.js,mozilla/pdf.js,nawawi/pdf.js,mukulmishra18/pdf.js,timvandermeij/pdf.js,mainegreen/pdf.js