Add a function to generate the "path" to an object.

It's sometimes useful to have a path from the outermost scope to the
innermost scope for an object. This function generates a list of tuples
that do just that. It also canonicalizes the names for the kinds of
objects: Function, Method, Class, etc.