Porting to Python 3 finished

It's passed all the unittest both under Python 2 and Python 3.
For stream manipulating, we always use ByteArray,
For paths and other literal, we just str under Python 2, and str under Python 3,
so we can use a single code base without modification.