Modified Plugin to use promises for event queues to avoid race conditions
Refactored test configuration, added tests and fixes