Move more code here now that MonoMac has the new Dispose semantics.