Flexible functional async breadth first search for node.js