export everything from Internal module
handle code attribute in stanza errors

rfc 3920 allowed a "code" attribute in stanza errors. For compatibility,
we allow for (but ignore) it.
re-add debug output to outbound stanzas
fix some outdated comments
add support for extended attributes

See RFC6120 §8.4
( http://xmpp.org/rfcs/rfc6120.html#stanzas-extended )