Fix order for predefined ancestors
Minor refactor
Modify ancestor chain in sgAncestor directive