 unless jQuery? then console.warn "Aui: window.jQuery not found, Modules and Semantic-UI will be disabled."
 unless jQuery?.site?.settings?.modules? then console.warn 'Aui: No Semantic-UI window.jQuery.site.settings.modules found, Semantic will be disabled.'
 
-## mixin AuiMixin
-# !EXPIRIMENTAL
-# Automatically wraps your render function with an <Aui>tag</Aui> with default props
+## mixin Aui.Mixin
+# Aui class is the main wrapper class
+# it recursively goes through all it's children,
+# finding props that === true or are on the `Aui.modules` list,
+# and merges them into the className of each element.
 AuiMixin =
   componentWillMount: ->
     render = @render
     @render = ->
-      console.log 'Aui.Mixin'
-      element = Aui.classify (render?.apply? @, arguments), @props
-      unless React.isValidElement element
-        console.error 'Aui: Child is not a valid Element:', element
-        return React.DOM.span null, element
-      element
+      element = render?.apply? @, arguments
+      if React.isValidElement element
+        Aui.classify element, @props
+      else
+        Aui.classify (Aui.warning 'Aui.Mixin: Child is not a React.isValidElement', element), @props
 
 ## class <Aui/>
-# Aui class is the main wrapper class
-# it recursively goes through all it's children,
-# finding props that === true or are on the `Aui.modules` list,
-# and merges them into the className of each element.
+# A tag that applies the Aui.Mixin
 Aui = React.createClass
   mixins: [AuiMixin]
   render: -> @props.children
 Aui.Aui = Aui
 Aui.Mixin = Aui.AuiMixin = AuiMixin
+
+## function Aui.warning (string, element)
+# console.warn a warning message
+# returns the element wrapped in a warning span
+Aui.warning = (message, element) ->
+  console.warn message, element
+  React.DOM.span { 'data-warning': message }, element
 
 ## object Aui.defaults
 # The default options Aui uses when no options or props are passed in.

    for own key, value of Aui.defaults
      @[key] = if options[key]? then options[key] else value

## element `Aui.classify(ReactElement, {...props}, { boolean modules })`
# finds all the props that === true or are on the `Aui.modules` list,
# and merging them with the className prop.
# `Aui.classify(<div ui grid><div column>content</div></div>)`
# returns `<div ui grid className="ui grid"><div column className="column">content</div></div>`
Aui.classify = (parent, options) ->
  options = AuiOptions options
  classify = (element) ->
    return element unless React.isValidElement element
    classNames = {}

# 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
