Migration from dojo/_base/array to ES5 functions (and some unrelated cosmetic fixes)