Use six for strings / unicodes / bytes
string.letters doesn’t exist any more in Python3.
Fixed random key generation.
httplib compatibility with python3.