Refactored task parallelism to Parallel.invoke

I am a PhD student in the CS department at the University of Illinois. I'm currently doing research on refactoring tools for parallel programming. I developed a tool that migrates Thread constructs to Task and convert some Task patterns to higher-level more scalable Parallel class.

The tool found an opportunity in your application and performed some changes. The program behavior does not change at all. If you are not interested in the Pull Request, please let me know why. 

Thanks!