Factor out a standalone EventPump for use in tests etc.

Good catch, done.