[log] Remake DFS without recursion.
[log] Move GraphFlags to api.