         # Branch
         else if isBranch attrs
             node = new DataContextNode type: attrs.type
-            children = _.map attrs.children, (_attrs) -> DataContextNode.parseAttrs _attrs, node, callback
+            children = _.map attrs.children, (_attrs) ->
+                DataContextNode.parseAttrs _attrs, node, callback
             node.set children: children
         # Condition
         else if isCondition attrs

        attrs.composite is true and attrs.id


    class DataContextNode extends Backbone.Model
        validate: (attrs) ->
            # Some kind of node
            if isBranch(attrs) or isCondition(attrs) or isComposite attrs
                return

            # Check for all undefined values
            for key, value of attrs
                if value isnt undefined
                    return 'Unknown node type'

            return

        toJSON: ->

                json = super
            return json

        isRoot: -> not @parent?

        isEmpty: -> _.isEmpty @attributes

        isBranch: -> isBranch @attributes

        isCondition: -> isCondition @attributes

        isComposite: -> isComposite @attributes

        # Retrieve this node's siblings
        siblings: ->
            if @isRoot() then false else _.without @parent.get('children'), @

        # Creates a new branch and adds this node along with one or more other
        # nodes to the branch
        promote: (nodes...) ->
            if nodes.length is 0
                throw new Error 'At least one node must be supplied'

            if @isRoot()
                type = 'and'
            # Alternate operators at each level. If the parent and child
            # branches have the same operator, the child can be demoted.
            else
                type = if @parent.get('type') is 'and' then 'or' else 'and'

            # Pass this node's attributes in the map parser to convert into
            # a newly referenced node.
            children = _.map [@attributes, nodes...], (attrs) =>
                DataContextNode.parseAttrs attrs, @

            # Clear the existing attributes and set the new ones
            @clear slient: true
            @set type: type, children: children
            return @

        # Takes a node and removes it from the current branch and adds it
        # to the branch's parent. If the branch has only one node left, it
        # too gets demoted and the branch is destroyed.
        demote: ->
            # Nothing to do if this is the root
            if @isRoot() then return false

            # If the parent is the root and this is the only child node, can
            # it be demoted. This is a special case when the root is a branch
            # and one of the children has been removed. Since this will cause
            # the other sibling to be demoted, this will ensure the single
            # condition becomes the root.
            if @parent.isRoot()
                if @siblings().length is 0
                    @parent.clear silent: true
                    @parent.set @attributes
