         when 'branch'
             error.throw "Branch tiles cannot spawn new children post-creation."
 
-newTile tiles, 0
+module.exports = ->
+    newTile tiles, 0
+    newTile tiles, 1
 
-module.exports = ->
-    ($ document).ready ->
-        ($ '.tael-container')
-        .append(
-            ($ '<div>')
-            .addClass 'tael-node-leaf'
-            .text tiles[1].value.content.data
-        )

tiles = [
    new ref
        type: 'container'
        child: undefined
]

newTile = (tiles, parent_id) ->
    # Add a new tile to the `tiles` array.
    pushTile = ->
        # Push a new tile to the `tiles` array and return its index.
        (
            tiles.push new ref
                type: 'leaf'
                content:
                    # To be added to
                    dom: null
                    data: 'foo'
        ) - 1
    
    addLeafToContainer = (parent) ->
        # Create only one tile and add it as the child of the supplied parent.
        # As the container tile is the top-level tile, it has only a single
        # child tile.
        parent.tile.value.child = do pushTile
    
    addLeavesToLeaf = (parent) ->
        # Create two tiles; convert the 'leaf' tile into a 'branch' tile

        # 'branch' tile.
        parent.tile.value =
            type: 'branch'
            content:
                dom:
                    parent.tile.value.content.dom
                    .attr 'class', 'tael-node-branch'
                    .html ''
            children:
                left: pushTile parent
                right: pushTile parent
            layout:
                split: 'horizontal'
                divider_location: 0.5
