Add unit tests for Tasks
Fix task problem when define an agent in actors of a taskjob