Refactored topsort_component() to avoid duplicate stacking of seen nodes.

Currently the topsort_component pushes all successors to the stack
irrespective of it that node is already on the stack. This leads to
node having multiple incoming edges to be on stack only to be popped
later. The change also align this method with post-traverse since both
methods almost perform the same function, except for the check on
'explored' nodes to detect cycles.
Add edge case tests
Merge pull request #21 from gdevanla/refactor_topsort_component

Refactored topsort_component() to avoid duplicate stacking of seen nodes...