Made event loop fully generic

Closes https://github.com/PistonDevelopers/event/issues/287