sessionmanager: add a global running flag.
application: remove a useless application class. Integrate all in the main().