Feature/task manager

This includes a series of bugfixes and improvements to the task manager.