Added Mac OS application quit shortcut and changed code to use default engine quitting scheme.
Fix bad refactor.