Add basic scope tracking to the Path abstraction.

The plan is to add more methods to Scope.prototype soon, for things like
looking up variable references and identifying free variables.