JavaScript domain model that provides type-checking and constraint validation for properties