Implement subtask

Not ready to merge yet, just putting here to show things.
Still need to test, improve documentation and refactor few things.
Nothing much changed, since the subtasks is just another graph.