Runs the application (called by main method or by embedding process).
The main entry point for the application.