Port to Python3

Do some change to make your unittest passed on Python 2.7.6, 3.3 and 3.4rc2