rework debugging/tracing features
Merge pull request #662 from guard/fix_kernel_system_debug

rework debugging/tracing features
set debug log level earlier
reverted to original clearing behavior [close #655]