https://github.com/mbostock/queue says, about await and awaitAll:
This method should only be called once, after any tasks have been
deferred. If the await callback is set multiple times, or set before
a task is deferred, the behavior of the queue is undefined.
At the moment, you call awaitAll after every time you defer a task, which is some definite dragon-tickling. Is there a place you can all awaitAll after queueing everything? If not, this particularly library may not be right for you.