Factor out a standalone EventPump for use in tests etc.

Maybe should have "Thread" in the name?