     for own key, value of element.props
       classNames[key] = yes if value is yes
       if (not options.disableModules) and (Array.isArray value) and (key in Aui.modules)
-        unless modules then modules = []
-        classNames[key] = true
-        modules.push key
+        classNames[key] = yes
+        modules or= {}
+        modules[key] = value
       props[key] = value
     props.className = Object.keys(classNames).join ' '
     unless props.className.length
       delete props.className
-    console.log modules, (if typeof element.type is 'string' then element.type else 'Component'), props.className or ''
+    #console.log modules, (if typeof element.type is 'string' then element.type else 'Component'), props.className or ''
     element = React.cloneElement element, props, if options.ignoreChildren then element.props.children else React.Children.map element.props.children, classify
     if modules
-      React.createElement Aui.Module, { modules }, element
+      React.createElement Aui.Module, { modules, options }, element
     else element
   classify element
 

# but in theory could be used to call any `window.jQuery.fn` function
Aui.modules = (jQuery?.site?.settings?.modules or []).slice()

## internal cache of options passed to modules.
moduleCache = {}
## internal class <Aui.Module/>
# This class provides support for `Aui.modules` and handles calling jQuery.fn[module] calls
Aui.Module = React.createClass
  render: -> React.Children.only @props.children
  componentDidMount: -> @callModules @props.children.props
  componentWillReceiveProps: (props) -> @callModules props.children.props
  callModules: (props) ->
    $element = jQuery React.findDOMNode @
    moduleId = $element.attr 'data-reactid'
    if moduleId isnt @moduleId
      console.log 'moduleId isnt @moduleId', moduleId, @moduleId
      delete moduleCache[@moduleId]
    @moduleId = moduleId
    moduleCache[@moduleId] or= {}
    for module, options in @props.modules
      cacheOptions = JSON.stringify options
      if moduleCache[@moduleId][module] isnt cacheOptions
        moduleCache[@moduleId][module] = cacheOptions
        ($element)[module] @props.children.props[module]...
    return
  componentWillUnmount: ->
    delete moduleCache[@moduleId]
window?.Aui = Aui
module?.exports = Aui

Aui.classify = (element, options) ->
  options = AuiOptions options
  unless React.isValidElement element
    element = Aui.warning 'Aui.classify: element is not a React.isValidElement', element
  classify = (element) ->
    return element unless React.isValidElement element
    classNames = {}
