     # Initialize outline
     outline = new birch.Outline.createTaskPaperOutline(syncMaster.data)
     outlineView = new OutlineView(syncMaster, outline)
+
+
+    spy.syncMaster = syncMaster
+    spy.docView = docView
+    spy.outlineView = outlineView
 
 
     cmTaskpaper.title.text = 'CodeMirror View'

            @outline = outline

            outline.onDidEndChanges () =>
                @syncMaster.update(@, @outline.serialize())

            amplify.subscribe 'data-updated', (source, data) =>
                if source isnt this
                    if data isnt @outline.serialize()
                        outline.reloadSerialization(data)


    panel = new DockPanel()
    panel.id = 'main'

    class SyncView
        constructor: (syncMaster) ->
            @syncMaster = syncMaster
            @data = syncMaster.data

            amplify.subscribe 'data-updated', (source, data) =>
                @onUpdate(source, data)

        onDataUpdated: (source, data) ->
            if this isnt source and @data isnt data
                @data = data
                return true
            else
                return false

    class DocView extends SyncView
        constructor: (syncMaster, doc) ->
            super(syncMaster)
            @doc = doc
            @doc.setValue(@data)

            @doc.on 'change', () =>
                @data = @doc.getValue()
                @syncMaster.update(this, @data)

        onDataUpdated: (source, data) =>
            if super(source, data)
                @doc.setValue(@data)


    class OutlineView extends SyncView
