/* private functions 
@function makeImmutable

make immutable functions if the model view is synchronous or create an
immutable module with methods if the model view is asynchronous.

each, post, and pre functions on the modelView will be replaced with
appropriate immutable versions.

@param {ImmutableCoreModelView} modelView

@throws {Error}
function makeImmutable (modelView) {
    // give model view a module name - this will be used for immutable module
    // for async  model views or for the base of function name for sync
    modelView.moduleName = modelView.name+'ModelView'
    // create immutable functions/module/methods
    return modelView.synchronous
        ? makeImmutableSynchronous(modelView)
        : makeImmutableAsynchronous(modelView)
}