     @iframe = this._createIframe(@container)
     @iframeDoc = @iframe.contentWindow.document
     @doc = new Tandem.Document(@iframeDoc.body)
-    @iframeDoc.body.addEventListener('DOMSubtreeModified', _.debounce((event) ->
-      console.log 'DOMSubtreeModified', event
+    @ignoreDomChanges = false
+    @iframeDoc.body.addEventListener('DOMSubtreeModified', _.debounce( ->
+      return if @ignoreDomChanges
+      # Normalize
+      # Detect changes
+      # Callback
+      console.log 'DOMSubtreeModified'
     , 100))
 
   _appendStyles: (doc) ->

    return iframe

  insertAt: (startIndex, text, attributes = {}) ->
    this.preserveSelection(range, text.length, ->

    )
    # 1. Save selection
    # 2. Split text into lines
    # 3. Find node where it starts


  # applyAttribute: (TandemRange range, Object attribute) ->
  # applyAttribute: (Number startIndex, Number length, attribute) ->
  applyAttribute: (startIndex, length, attribute) ->
    @ignoreDomChanges = true
    range = if _.isNumber(startIndex) then new Tandem.Range(this, startIndex, startIndex + length) else startIndex
    this.preserveSelection(range, 0, =>
      range.splitEnds()
      _.each(range.groupNodesByLine(), (elems) =>
