Python 3 compatibility for json serializer

Hmmm... actually, I think the problem was fernet_decode all along. :-/

If I remove the fernet_encode changes entirely things still work for me.