Add tox config
Fix py3 issue with bas64 encoding