Loop over an array in order, processing elements with an asynchronous function.