Worker queue to execute tasks asyncronously in Javascript