Allow ns_dict to override/append to auto_namespaces
Optional idgen namespace gathering in to_xml()

Since the idgen namespace settings are at the module-level, they could
cause thread-safety issues, depending on the use.

This patch moves the idgen gathering up to the to_xml() and out of
nsparser, and optional by using the include_idgen=T/F parameter to
to_xml.

To implement a thread-safe to_xml() call, the caller should disable the
include_idgen, and provide the needed namespaces using the ns_dict
parameter.
Merge branch 'speedup-nsdict' into nsdict
Merge branch 'speedup-nsdict-threadsafe' into nsdict-threadsafe
Fix Unicode / UTF8 mixing in to_xml()

During encode(), some write operations are decorated with
encode(ExternalEncoding), but others are not.

If any unicode strings end up in the non-encoded outputs, the StringIO
buffer accumulates a mix of String and Unicode, which it can't handle.
Merge remote branch 'mitre/master' into nsdict
Merge remote branch 'mitre/master' into nsdict-threadsafe

Conflicts:
	stix/base.py
	stix/utils/nsparser.py
Merge remote branch 'mitre/master' into unicodefix

Conflicts:
	stix/base.py
Merge branch 'nsdict' into edge4
Merge branch 'nsdict-threadsafe' into edge4
Merge branch 'unicodefix' into edge4
Merge branch 'idns' into edge4
Add export