Move main loop out of engine class.
Protect session::run() from concurrent calls.