Made event loop fully generic

Closes https://github.com/PistonDevelopers/event/issues/287
Merge pull request #288 from bvssvni/master

Made event loop fully generic