Various V5

V4 +

- Re-factor in 2 commits, one for Task, one for Chain Task
- Fix double free.