add ktest support and refactor commands module