Javascript parallel/async and sequential/sync control util