       
     return model.makePatches(modelData)
 
-  runStep: (model, assets, actions, layout, bindings = {}) ->
+  nodeVisitors: 
+    "action": visitActionNode
+    "call": visitCallNode
+    "bind": visitBindNode
+    "setModel": visitSetModelNode
+
+  # Constants are modelData, assets, actions, and serviceData
+  visitNode: (node, bindings, constants) ->
     # TODO: defer action and call execution until whole tree is evaluated?
     # TODO: handle children as object in addition to array
 
+    for nodeType, visitor of nodeVisitors
+      if nodeType of layout
+        return visitor(node, bindings, constants)
+
+    GE.logError("Layout item is not understood")
+
+    return makeNodeVisitorResult()
+
     # List of patches to apply, across all actions
-    patches = []
+    modelPatches = []
+    servicePatches = {}
     result = undefined
 
-    if "action" of layout
       if layout.action not of actions then throw new Error("Cannot find action '#{layout.action}'")
 
       childNames = if layout.children? then [0..layout.children.length - 1] else []

  # Shortcut for timeout function, to avoid trailing the time at the end 
  doLater: (f) -> setTimeout(f, 0)

# Install the GE namespace in the global scope
globals.GE = GE


    images: ["png", "gif", "jpeg", "jpg"]
    js: ["js"]

  makeConstantSet: makeConstantSet

  # There is probably a faster way to do this 
