Factor out a standalone EventPump for use in tests etc.
Merge pull request #343 from AlCutter/event_pump

Factor out a standalone EventPump for use in tests etc.