Replace Namespace#self_and_ancestors with linear version
We are now storing the Namespace path from root_ancestor to self on each Namespace. We will utilize this information to replace each recursive method in !52999 (merged) (diffs)
This issue is to replace the Namespace#self_and_ancestors with a linear version.
Note that this work has previously been through a significant review process. Unfortunately the MR grew so large that it is now being split in to multiple MRs for the purpose of deployment.
This work will sit behind a use_traversal_ids feature flag.