Factor out a standalone EventPump for use in tests etc.

This would probably deserve a ```DISALLOW_COPY_AND_ASSIGN```.