graph: Reorganize combine_nodes() to support different hash algorithm.

We need to calculate all hashes first before pruning nodes, since pruned nodes may affect other hashes that should be the same.
graph: Fix command hash func to use first word with ^ blah^ markers
graph: Only show normal links by default.
Added t4139 - combine commands based on commands up/down the tree.

Instead of only checking one level, we check the whole graph of commands, so we can combine long chains of commands together.
Added t4140 - combine graphs that have different numbers of the same command type.

In one case we generate 1 header, and in another case 2 headers - if one gcc command uses 1 and another uses 2, we can still combine them. This is done by keeping track of unique input/output commands.
Fix t4139, t4140 for Windows.