fix python2.6 compat and refacto per as @Adonoho's #201
fix python2.6 compat and refacto per as @Adonoho's #201

hugovk/twitter,sixohsix/twitter,tytek2012/twitter,jessamynsmith/twitter,Adai0808/twitter,miragshin/twitter