Python 3 compatibility

This adds Python 3 compatibility. Mostly. HOTP/TOTP tests pass, I think. OCRA is still broken because of str/bytes issues.