Pagination: avoid superfluous queries on last page
Fix #353 by altering newRow signature to allow passing parent node
Tweak newRow placement fix to try parent based on nextNode as well