Implement emulator console
Use return instead of exit() in main()