Use strict REST domain objects

 - For `ModuleMetadataResource`'s module type and deployment status,
use `RESTModuleType` and `RESTDeploymentState` that represent the
module type and DeploymentUnitStatus.State.
Sometimes tests end up with deployment status not set at the model `ModuleMetadata` and thats the reason I have added a null check here.