Main Event Loop class