Clean up and unit tests, base64url impl