Extract component base class
This extracts a Component
base class, removing a lot of redundancy and improving maintainability (I did this mainly because I found a need to add some code to the instance
method, which I would have had to add to every component if I hadn't refactored first).
This also refactors the registry login handling, as mentioned in https://gitlab.com/gitlab-org/gitlab-qa/-/merge_requests/465#note_351431872