Implement a timed event queue.

Closes #205.