Import some more code to work towards replication
Correct the name of the package
Backport domgen change