 
 NewNotebookComponent = React.createClass
   displayName: 'NewNotebookComponent'
-  render: ->
+  mixins: [AppAwareMixin]
+  render: ->
+    {imports, module_names} = @context.app
     intro_command = Settings.get 'app', 'intro_command'
     if intro_command? and intro_command != ''
-      SingleCoffeeScriptCellNotebookComponent {value: intro_command}
+      SingleCoffeeScriptCellNotebookComponent {app: @context.app, value: intro_command}
     else
       Notebook.NotebookComponent {imports, module_names, init: (nb) ->
         Notebook.focus_cell Notebook.add_input_cell nb

      mixins: [Router.Navigation]
      render: -> fn.call(@); null

  routesComponent = Routes null,
    Route {handler: AppComponent, bodyWrapper},
      Route path: '/', name: 'default', handler: null_route ->
        queryKeys = Object.keys(@props.query)
        if queryKeys.length == 1 and @props.query[queryKeys[0]].length == 0

    Settings.user_settings.set JSON.parse(localStorage.getItem 'lead_user_settings') ? {}
  catch e
    console.error 'failed loading user settings', e

  module_names = ['http', 'dsl', 'graphing', 'settings', 'input', 'notebook']

  imports = [
    'builtins.*'
    'server.*'
    'github.*'
    'graphing.*',
    'compat.*',
    'opentsdb.tsd'
  ]

  imports.push (Settings.get('app', 'imports') or [])...
  module_names.push _.map(imports, (i) -> i.split('.')[0])...
  module_names.push (Settings.get('app', 'module_names') or [])...

  window.addEventListener 'storage', (e) =>
    if e.key == 'lead_user_settings'
