Changed Task.Run wrappers of Sync calls to use async/await instead.

Changed Task.Run wrappers of Sync calls to use async/await instead. This
avoids the creation of extra threads.

Tabs have been replaced with 2 spaces. Code duplication has been eliminated.