Added predLinks and succLinks to the constructor function of BaseNode. Code refactoring in sortTopological().