Add the sub() method.

Still with plenty of repeated code to be factored out.
.gitlab-ci.yml not found in this commit