simple javascript queue that deal with sequential processing