Refactor event loop into loop.js