Prepare code for resumable and retryable chunked upload.
Remove check for chunkArgs.cancelled - probably some legacy code.
Avoid firing CancelUpload when upload is complete. Manually change uploader state to STOPPED and fire StateChanged.
Detach xhr.onload handlers, otherwise they interfere.