Completely remove the use of gds_*_replace_cb

Instead, use internal functions that swap two nodes.