 ###
 
 _ = require "lodash"
+async = require "async"
 teacup = require "teacup"
 assert = require "assert"
 

        @element = $ renderable(@constructor::element) @
        @element.addClass "semantic-widget", @reference
        @element.appendTo (try @container or undefined)
        @payload.call this, @element, @reference or 0
        assert identify = try @constructor.identify()
        assert ref = try @reference.toString().bold
        logger.debug msg, identify.bold, ref.bold

        noContainer = "no valid container object supplied"
        noReference = "no valid reference string supplied"
        noPayload = "something wrong with payload function"
        @payload = (->) if _.isEmpty @payload or undefined
        assert _.isObject(@container or null), noContainer
        assert _.isString(@reference or null), noReference
        assert _.isFunction(@payload or null), noPayload
