Reset global state between DFS calls, minor jsdoc fix

DFS algorithm uses global (module-scope) variables `time`, `visitedNodes`, `finishingTimes`, and successive calls share their values. This patch fixes it.