Improved async task logic.

Fix up deadlock issues.
Still not very fast, but at least correct vs original simplified buggy
code.
Async: It now works.