Add self_and_ancestors method for Tree plugin