     }])
     expect(collect(cylinders)).to.deep.equal([8])
   it "supports deep nesting", ->
-    cylinders = lib.Model(12)
-    seats = lib.Model(4)
-    car = lib.Model.combine {
+    cylinders = Model(12)
+    seats = Model(4)
+    car = Model.combine {
       engine: { cylinders},
       interior: {
         seats: { count: seats }


describe "Model.combine", ->
  it "creates a new model using a template", ->
    cylinders = lib.Model(12)
    doors = lib.Model(2)
    car = lib.Model.combine {
      price: "expensive",
      engine: { type: "gas", cylinders},
      doors

    values = collect(stuff)
    root.set({first:"f", last:"l"})
    expect(values).to.deep.equal([
      {},
      {first: "f"},
      {first: "f", last: "l"}])
  it "works when pushing within bacon dispatch", ->
    model = Model {field1: "init"}
    valueLens = model.lens("field1")
    Bacon.once(1).onValue ->
      valueLens.set("value1")
      expect(valueLens.get()).to.equal("value1")
    expect(valueLens.get()).to.equal("value1")
  it "works when creating lens and pushing within bacon dispatch", ->
    model = Model {field1: "init"}
    model.lens("field1")
    Bacon.once(1).onValue ->
      valueLens = model.lens("field1")
      valueLens.set("value1")
      expect(valueLens.get()).to.equal("value1")
    expect(model.lens("field1").get()).to.equal("value1")
  it "gets undefined when model structure has been destroyed", ->
    model = Model {users: [{name: "Dan"}]}
    nameLens = model.lens('users.0.name')
    expect(nameLens.get()).to.equal("Dan")
    model.set({users: []})
