update binary, text, IO, specific code and tests for python 3 compatibility

general:
- use string checking with instanceof text and binary types
- use six.text_type for string objects
- use six.ByteIO for in memory IO objects
- use binary file read/write
- add more exception checking for detect HTTPMessage headers
- fix object.__new__ with arguments deprecated usage for python 3.3+
- fix some dictionaries ordering for python 3+
- fix lxml etree.fromstring with text_type for python 3+
- fix xml Element definition
- fix text and binary concatenation for python 3+ for utils module

tests:
- add skipping written bytes for file write in python 3+
- add skipping custom exceptions details
- add skipping TypeError details
- fix binary to text casting for non binary APIs like json
- fix test to binary casting for non text APIs like xml
- fix unicode comparison in tests