various {d,p,q} egp3 - related bits of code

This may be the missing bits of EGP3