Moved the base64 encoding to the infra package

Since it should be shared...