Move CWT class to detect sub-package
Clean up cwt module and script a bit.
Some further cleanup of CWT class and script