[javascript] How can I wait for set of asynchronous callback functions?