An events based queue iteration JavaScript module