anchor.diff:          editorArea.selectFile(resource, switchesTab: true);
         });
       });
  -
  +  }
  +
  +  void initEditorArea() {
  +    editor = new AceEditor(new DivElement());
       editorArea = new EditorArea(document.getElementById('editorArea'),
  -                                editorManager,
  -                                allowsLabelBar: true);
  +        editorManager,
  +        allowsLabelBar: true);
       editorArea.onSelected.listen((EditorTab tab) {
         _filesController.selectFile(tab.file);
         localPrefs.setValue('lastFileSelection', tab.file.path);
       });
  +  }
  +
  +  void initEditorThemes() {
  +    syncPrefs.getValue('aceTheme').then((String theme) {
  +      if (theme != null && AceEditor.THEMES.contains(theme)) {
  +        editor.theme = theme;
  +      }
  +    });
  +  }
  +
  +  void initFilesController() {
       _filesController = new FilesController(workspace, this);
  -
  -    setupSplitView();
  -    setupFileActions();
  -    setupEditorThemes();
  -
  -    // Init the bootjack library (a wrapper around bootstrap).
  +  }
  +
  +  void initLookAndFeel() {
  +    // Init the Bootjack library (a wrapper around Bootstrap).
       bootjack.Bootjack.useDefault();
  -
  -    createActions();
  -    buildMenu();
  -
  -    actionManager.registerKeyListener();
  -  }
  -
  -  String get appName => i18n('app_name');
  -
  -  String get appVersion => chrome.runtime.getManifest()['version'];
  -
  -  PlatformInfo get platformInfo => _platformInfo;
  -
  -  void setupSplitView() {
  +  }
  +
  +  void initSplitView() {
       _splitView = new SplitView(querySelector('#splitview'));
       _splitView.onResized.listen((_) {
         editor.resize();
  
positive.code:     });
    }
  
    void setupFileActions() {
      querySelector("#newFile").onClick.listen(
          (_) => actionManager.getAction('file-new').invoke());
      querySelector("#openFile").onClick.listen(
          (_) => actionManager.getAction('file-open').invoke());
    }
  
    void setupEditorThemes() {
      syncPrefs.getValue('aceTheme').then((String theme) {
        if (theme != null && AceEditor.THEMES.contains(theme)) {
          editor.theme = theme;
        }
      });
    }
  
    void newFile() => notImplemented('Spark.newFile()');
  
    void openFile() {
  
negative.code:     localPrefs = preferences.localStore;
      syncPrefs = preferences.syncStore;
  
      initAnalytics();
  
      addParticipant(new _SparkSetupParticipant(this));
  
      // TODO: this event is not being fired. A bug with chrome apps / Dartium?
      chrome.app.window.onClosed.listen((_) {
        close();
      });
  
      initWorkspace();
      initEditor();
      initEditorManager();
      initEditorArea();
      initEditorThemes();
      initFilesController();
  
      initLookAndFeel();
  
      createActions();
      initToolbar();
      initSplitView();
    }
  
    String get appName => i18n('app_name');
  
    String get appVersion => chrome.runtime.getManifest()['version'];
  
    PlatformInfo get platformInfo => _platformInfo;
  
    //
    // Parts of ctor:
    //
  
    void initAnalytics() {
      analytics.getService('Spark').then((service) {
        // Init the analytics tracker and send a page view for the main page.
        tracker = service.getTracker(_ANALYTICS_ID);
        tracker.sendAppView('main');
        _startTrackingExceptions();
      });
    }
  
    void initWorkspace() {
      workspace = new ws.Workspace(localPrefs);
    }
  
    void initEditor() {
      editor = new AceEditor(new DivElement());
    }
  
    void initEditorManager() {
      editorManager = new EditorManager(workspace, editor, localPrefs);
      editorManager.loaded.then((_) {
        List<ws.Resource> files = editorManager.files.toList();
  