Replace more linked lists with queue.h implementations
We've got linked lists scattered through our source. Now that we have a queue.h implementation, it would be neat to use that instead.
This is something we can (and should!) do piecemeal; let's not try to do it all with one big patch.