add --debug parameter to ktest and print stack traces only when that's used
add a line of documentation
replace some strings with constants for uniformity