#1843: Refactor to use direct db queries rather than node_load.