   'underscore'
 ], ($, _) ->
 
-  # $.visualTest
-  # ------------
-
-  # The test function generator. Invoke tests on document ready.
-  # Configuration:
+  # __$.visualTest__ returns a configured test function generator. Tests should
+  # be invoked tests on document ready. Configuration:
   # 
   # - `label` - header text describing the test topic.
   # - `anchorName` - for the section on its docs page, used to generate `docsUrl`.
   # - `asFragments` - will render the test differently, directly inside `<body>`.
   # - `className` - a hook for any custom css.
   # - `footerHtml` - optional html for controls for additional testing.
+  #
+  # It will:
+  # 1. Ensure config.
+  # 2. Build test template vars.
+  # 3. Render test to get test context (or fragments).
+  # 4. Run tests.
+  #
+  # It also includes helpers for additional setup. `setupAppendButton` inits a
+  # button for appending an item to a list, and should be included as part of
+  # `footerHtml`.
   $.visualTest = (config) ->
     ->
-      # - Ensure config.
       config.vars ?= {}
-      # - Build test template vars.
+
       vars = _.pick config, 'label', 'className', 'footerHtml'
       vars.footerHtml ?= '' unless config.asFragments
       vars.docsUrl = $('body > header [data-rel=docs]').attr('href') + "##{config.anchorName}"
       vars.html = _.template config.template, config.vars
-      # - Render test to get test context (or fragments).
+
       $container = if config.asFragments then $('body') else $('#main')
       opts = { template: '<%= html %>' } if config.asFragments
       $test = $container.renderVisualTest vars, opts

    $test = $ opts.template vars 
    @.append $test
    $test

  $.fn.renderVisualTest.defaults =
    template: _.template """
              <section class="<%- className %> visual-test">

        $list.append $newItem
        updateItem $newItem if updateItem?

  # __$.fn.renderVisualTest__ is a simple method for an element to render and
  # append a test. Only provide a custom template if absolutely needed.
  $.fn.renderVisualTest = (vars, opts) ->
    opts ?= {}
    _.defaults opts, $.fn.renderVisualTest.defaults
