Convert ancestor and descendant_nodes to scope

Something made me think these wouldn't work as scopes, but @laserlemon
pointed out on the pull request that they would.