Refactor Trace::files() and Trace::fileHierarchy() functions: return objects.