Fix executing UI commands

UI commands were broken by a1d7aeec6088b7c96c366b413e3c15d8f3dc0b4a which requires all commands to be added using trap_AddCommand.
Did some cleanup/refactoring of cgame console command code.