Pre-calculate shortest paths from main() to all functions to significantly speed up printing of privileged stack traces.

Use Dijkstra's algorithm to reasonably efficiently compute the shortest path from main() to all other functions. We then use this when printing out stack traces from main() to a function foo()