anchor.diff:              match loop with
               | Idle(handle, wakeup) -> let memory = new MemoryPool()
                                         loop <- LoopState.Running(handle, wakeup, memory)
  -                                      handle.Init(libuv)
  -
  -                                      let create(token: int64, fsm: Machine<'c>) = fsm.init handle (fun () -> runOnce token fsm fsm.machine.timeout)
  -                                                                                   runOnce token fsm fsm.machine.create
  -
  -                                      //Deqeue at most l items
  -                                      //This is to make sure other events this loop iteration get a chance to run
  -                                      let rec dequeueAtMost l =  match l with
  -                                                                 | 0 -> ()
  -
  -                                                                 | _ -> match wakeup.dequeue with
  -                                                                        | true, token -> match (Map.tryFind token machines) with
  -                                                                                         | Some(fsm) -> match fsm.state with
  -                                                                                                        //Wakeups may get called on Uninitialised machines
  -                                                                                                        //We only run this check for wakeups
  -                                                                                                        | MachineState.Uninitialised -> create(token, fsm)
  -                                                                                                        | MachineState.Running -> ()
  -
  -                                                                                                        runOnce token fsm fsm.machine.wakeup
  -                                                                                         | _ -> ()
  -
  -                                                                                         dequeueAtMost (l - 1)
  -
  -                                                                        | false, _ ->    ()
  -
  -                                      //Initialise wakeup mechanism
  -                                      let handleWakeup () = dequeueAtMost (wakeup.length)
  -
  -                                                            match wakeup.length with
  -                                                            | 0 -> ()
  -                                                            | _ -> wakeup.wakeup
  -
  -                                      wakeup.init handle handleWakeup
  -
  -                                      //Initialise machines and timer callbacks
  -                                      machines |> Map.iter(fun token fsm -> match fsm.state with
  -                                                                            | MachineState.Uninitialised -> create(token, fsm)
  -                                                                            | MachineState.Running -> ())
  +
  +                                      init handle wakeup memory
   
                                         match machines.Count with
                                         | 0 -> 0
  
positive.code: 
              | Idle(_, _) ->                    ()
              
  
          /// Add a generic `IMachine<'c>` to the loop.
          /// 
          /// This can only be done if the loop is in the `Idle` state.
          member this.addMachine (f: EarlyScope -> 'a) =
              match loop with
              | Idle(loop, wakeup) -> let token = int64 machines.Count
                                      let scope = EarlyScope(token, loop, wakeup)
                                      let machine = f scope
  
                                      let machine = new Machine<'c>((machine :> IMachine<'c>), new UvTimerHandle())
                                      machines <- machines |> Map.add token machine
  
              | Closed ->             raise (NotImplementedException("Adding machines to dirty loops is not implemented"))
  
              | Running(_, _, _) ->   raise (NotImplementedException("Adding machines to running loops is not implemented"))
  
          /// Run the loop.
          /// 
  
negative.code: 
              | Closed ->                          ()
  
          /// Dipose and remove a machine.
          let remove token =
              let machine = Map.find token machines
              (machine :> IDisposable).Dispose()
  