Start of debugger

Also non-daemon mode and tidied up logging