Comments on waiting for tasks, optimized waiting code.
Comments on where to obtain application credentials.
Cleanup waiting code.