Emit key changed signal for command line options.

This fixes an issue where the logging level couldn't be set by the
command line.
Added asserts.
Enable verbose logging when running in debug mode.