Move editor event loop to Editor module