           build_map CodeMirror.keyMap[name] for name in fallthroughs
       build_map CodeMirror.keyMap.lead
 
-      @add_component KeyBindingComponent keys: all_keys, commands: CodeMirror.commands
+      KeyBindingComponent keys: all_keys, commands: CodeMirror.commands
 
     fn 'In', 'Gets previous input', (n) ->
       @value @get_input_value n
 
-    fn 'object', 'Prints an object as JSON', (o) ->
+    component_fn 'object', 'Prints an object as JSON', (o) ->
       try
         s = JSON.stringify(o, null, '  ')
       catch
         s = null
       s ||= new String o
-      @add_component source value: s, language: 'json'
+      source value: s, language: 'json'
 
     MarkdownComponent = React.createClass
       render: -> React.DOM.div className: 'user-html', dangerouslySetInnerHTML: __html: marked @props.value
 
-    fn 'md', 'Renders Markdown', (string) ->
-      @add_component MarkdownComponent value: string
+    component_fn 'md', 'Renders Markdown', (string) ->
+      MarkdownComponent value: string
 
     text = React.createClass
       render: -> React.DOM.p {}, @props.value

        else
          @props.ctx.set_code @props.value

    fn 'example', 'Makes a clickable code example', (value, opts) ->
      @add_component example {ctx: @, value, run: opts?.run ? true, language: 'coffeescript'}

    source = React.createClass
      render: -> React.DOM.pre()
      componentDidMount: (node) -> format_code @props.value, @props.language, node

    fn 'source', 'Shows source code with syntax highlighting', (language, value) ->
      @add_component source {language, value}

    cmd 'intro', 'Shows the intro message', ->
      ctx = @
      @add_component React.createClass(
        render: -> React.DOM.div {}, [
          text value: "Welcome to lead.js!\n\nPress Shift+Enter to execute the CoffeeScript in the console. Try running"
          example value: "browser '*'", ctx: ctx, run: true

            React.DOM.td {}, command.doc
          ]

    component_cmd 'keys', 'Shows the key bindings', ->
      all_keys = {}
      # TODO some commands are functions instead of names
      build_map = (map) ->
