application: Simplify handling commandline
The commandline code was annoyingly large, and not working well. It wasn't showing warning for unknown options. Also, the 'no-window' choice was not shown in --help.
Let's simplify this so that it will work, and be easy to understand
cc: @tobiasmue