Cleanup tasks

Cleanup task system. Somehow, running the tests still results in 100% CPU usage. I will have to figure out what causes this (it could be a deadlock X_X)