Add an internal factory method utility for defining the type property on a model.
/**
* A factory function that adds a `type` field to an Object
* @param {Object} object The Object to add the `type` field to
* @param {String} type The name of the type to add
* @return {Object} Returns the original object
*/
function addType(object, type) {
Object.defineProperty(object, `type`, {
configurable: false,
enumerable: true,
get() { return type; },
});
return object;
}