separating gui and backing code, and setting up cmdline switches.