Added support for relatedModel property as function, useful for requirejs circual dependencies