Cohomology and group extensions in Magma