     , Object.create(null))
     return rv
 
-proto.coerce = (aObject) ->
+gProto.coerce = (aObject) ->
     defs = @definitions
     rv = Object.keys(aObject).reduce((rv, key) ->
         value = aObject[key]

    if Object.keys(errors).length then return errors
    return null

proto.extend = (aProto) ->
    return


exports.create = (aDefinitions) ->
    definitions = Object.create(null)

    for own key, val of aDefinitions
        try
            def = normalizeDefinition(val)
        catch message
            throw new Error("Definition error '#{key}': #{message}")

        Object.defineProperty(definitions, key, {
            enumerable: yes
            value: def
        })

    self = Object.create(null, {
        definitions:
            value: Object.freeze(definitions)
        create:
            enumerable: yes
            value: proto.create
        clean:
            enumerable: yes
            value: proto.clean
        coerce:
            enumerable: yes
            value: proto.coerce
        validate:
            enumerable: yes
            value: proto.validate
    })

    return Object.freeze(self)


create = () ->
    model = Object.create(null)
    return Object.freeze(model)


extendDefinitions = do ->

    , Object.create(null))
    return rv

gProto.clean = (aObject) ->
    defs = @definitions
    rv = Object.keys(defs).reduce((rv, key) ->
        rv[key] = aObject[key]
