#533 - Adding ability to remove the download limit
#533 - Converting sql statement to use variables
#533 - Adding logic to set totalFilesExpectedToWrite and totalFilesWritten when startDownloading() begins so that the process knows if it's ok to start downloading as well as when it should stop and clean up.