ChainCompile: Better dependency traversal