Factor out a standalone EventPump for use in tests etc.

Done