Implement CwsDebug

Refactor code
Add License