Event queue implementation

Implements an EventQueue.