Fixed tree parsing
fixed some submodule related bugs
Added topological sort function for commits