             @publish statuses
 
     toElement: ->
-        element = $element "div", class: "view chorus_view"
+        element = $fromHTML '<div class="view chorus_view" />'
         PubSub.bind this, => @updateElement element
         @updateElement element
 

        destination[key] = value for key, value of source

    destination

$element = (name, props) ->
    el = document.createElement name
    for key, value of props
        switch typeof value
            when 'string', 'number'
                switch key
                    when 'class'
                        el.setAttribute('class', '' + value)

                    else el[key] = value

            when 'object' then extend el[key], value

    return el

$append = (el, children...) ->
    for child in children

    padding ?= "callback"
    head = document.getElementsByTagName("HEAD")[0]
    query = ("#{key}=#{value}&" for key, value of data).join('')
    key = "jsonp_callback_#{jsonp.uid}"
    script = document.createElement "script"
    script.type = "text/javascript"
    script.src = "#{url}?#{query}#{padding}=#{key}"

    window[key] = (data) ->
        delete window[key]
        head.removeChild script
        callback data

