Refactor: Drop ProfileResolver. Add a new ProfileTracker class.

The ProfileTracker can resolve names to profiles and track profile
references.