page loader refactored loop detection

Checking for ancestors by node.