Fixed race condition when building template maps. Made TemplateMapProvider and ModelAssemblyProvider thread safe.