anchor.diff:          if not found then raise (InvalidOperationException "entityId")
           &components.[index]
   
  -    member this.AddComponent entityId comp =
  -        if not (correlations.ContainsKey entityId) then
  -            if freeList.Count = 0 then
  -                if freeIndex < components.Length - 1 then
  -                    components.[freeIndex] <- comp
  -                    freeIndex <- inc freeIndex
  -                else
  -                    let arr = Array.zeroCreate (components.Length * 2)
  -                    components.CopyTo (arr, 0)
  -                    components <- arr
  -                    components.[freeIndex] <- comp
  -                    freeIndex <- inc freeIndex
  -                let index = dec freeIndex
  -                correlations.Add (entityId, index)
  -            else components.[freeList.Dequeue ()] <- comp
  -            true
  -        else false
  -
  -    member this.RemoveComponent entityId =
  +    member this.Register entityId : 't byref =
  +        if correlations.ContainsKey entityId then
  +            failwith ("Entity '" + scstring entityId + "' already registered.")
  +        let comp = Unchecked.defaultof<'t>
  +        if freeList.Count = 0 then
  +            if freeIndex < components.Length - 1 then
  +                components.[freeIndex] <- comp
  +                freeIndex <- inc freeIndex
  +            else
  +                let arr = Array.zeroCreate (components.Length * 2)
  +                components.CopyTo (arr, 0)
  +                components <- arr
  +                components.[freeIndex] <- comp
  +                freeIndex <- inc freeIndex
  +            let index = dec freeIndex
  +            correlations.Add (entityId, index)
  +            &components.[index]
  +        else
  +            let index = freeList.Dequeue ()
  +            components.[index] <- comp
  +            &components.[index]
  +
  +    member this.Unregister entityId =
           match correlations.TryGetValue entityId with
           | (true, index) ->
               if index <> freeIndex then
  -                components.[index].Occupied <- false
  +                components.[index].RefCount <- dec components.[index].RefCount
                   freeList.Enqueue index
               else freeIndex <- dec freeIndex
               true
           | (false, _) -> false
   
  -and [<NoEquality; NoComparison>] ComponentSource =
  -    | ComponentUncorrelated of string * int
  -    | ComponentCorrelated of string * Guid
  -    | ComponentSimulant of Simulant
  -
  -and SystemMapper =
  -    interface end
  -
  -and [<NoEquality; NoComparison>] SystemMapper<'i, 'd, 'w when 'i :> Component and 'd :> Component> =
  -    { SourcesToIntersection : ComponentSource array -> 'i
  -      IntersectionToDestination : 'i -> 'w -> 'd
  -      SystemSourceNames : string array
  -      SystemIntersectionName : string
  -      SystemDestinationName : string }
  -    interface SystemMapper
  -
  -and [<NoEquality; NoComparison>] SystemMappers =
  -  { Mappers : SystemMapper array }
  +and [<AbstractClass>] SystemIntersection<'t, 'w when 't : struct and 't :> Component>
  +    (correlatedSystemNames : string array, mapper : Dictionary<string, 'w System> -> Guid -> 'w Ecs -> 't) =
  +    inherit System<'w> ()
  +
  +    let mutable components = [||] : 't array
  +    let mutable freeIndex = 0
  +    let mutable intersectionsOpt = None : Dictionary<string, 'w System> option
  +    let freeList = Queue<int> ()
  +    let correlations = dictPlus [] : Dictionary<Guid, int>
  +    
  +    member this.Components
  +        with get () = components
  +    
  +    member this.FreeIndex
  +        with get () = freeIndex
  +
  +    member this.GetIntersections getSystem (ecs : 'w Ecs) =
  +        match intersectionsOpt with
  +        | Some intersections -> intersections
  +        | None ->
  +            let intersections = correlatedSystemNames |> Array.map (fun sourceName -> (sourceName, getSystem sourceName ecs)) |> dictPlus
  +            intersectionsOpt <- Some intersections
  +            intersections
  +
  +    member this.GetComponent entityId =
  +        let (found, index) = correlations.TryGetValue entityId
  +        if not found then raise (InvalidOperationException "entityId")
  +        &components.[index]
  +
  +    member this.Register entityId getSystem ecs =
  +        if correlations.ContainsKey entityId then
  +            failwith ("Entity '" + scstring entityId + "' already registered.")
  +        let intersections = this.GetIntersections getSystem ecs
  +        let comp = mapper intersections entityId ecs
  +        if freeList.Count = 0 then
  +            if freeIndex < components.Length - 1 then
  +                components.[freeIndex] <- comp
  +                freeIndex <- inc freeIndex
  +            else
  +                let arr = Array.zeroCreate (components.Length * 2)
  +                components.CopyTo (arr, 0)
  +                components <- arr
  +                components.[freeIndex] <- comp
  +                freeIndex <- inc freeIndex
  +            let index = dec freeIndex
  +            correlations.Add (entityId, index)
  +            &components.[index]
  +        else
  +            let index = freeList.Dequeue ()
  +            components.[index] <- comp
  +            &components.[index]
  +
  +    member this.Unregister entityId =
  +        match correlations.TryGetValue entityId with
  +        | (true, index) ->
  +            if index <> freeIndex then
  +                components.[index].RefCount <- dec components.[index].RefCount
  +                freeList.Enqueue index
  +            else freeIndex <- dec freeIndex
  +            true
  +        | (false, _) -> false
   
   /// NOTE: Uncorrelated systems can update in parallel.
   and [<NoEquality; NoComparison>] 'w Ecs =
  
positive.code:         tryGetSystem systemName ecs |> Option.get
  
      let getComponent<'t, 'w when 't : struct and 't :> Component> systemName index ecs =
          match tryGetSystem systemName ecs with
          | Some system ->
              match system with
              | :? SystemUncorrelated<'t, 'w> as systemUnc -> systemUnc.GetComponent index
              | _ -> failwith ("Could not find expected system '" + systemName + "' of required type.")
          | _ -> failwith ("Could not find expected system '" + systemName + "'.")
  
      let addComponent<'t, 'w when 't : struct and 't :> Component> systemName (comp : 't) ecs =
          match tryGetSystem systemName ecs with
  
negative.code:         Seq.map (fun (system : KeyValuePair<string, 'w System>) -> (system.Key, system.Value.Update ecs)) |>
          dictPlus
  
      let addSystem systemName system ecs =
          ecs.Systems.Add (systemName, system)
  
  