Factor out a standalone EventPump for use in tests etc.

Make it ```const```?