remove relative imports
dependencies added
handle bytes or string from stream.read() for py2 and 3 support