Refactoring

Module reorganization
The CState should not be accessed directly from the Class module.
Utility function must be used instead.