fix issue - TransUnitUpdated event will cause editor in unsaved style

The order is important.
CodeMirror onchange event will fire up and mark editor as unsaved (when TransUnitUpdated event received from server and editor gets udpated). 
So setting state to saved must happen after setting code mirror value.
The test will ensure this.