Rewrite u2gpd in terms of qgpd

Reduce code duplication.
Merge pull request #9 from pdmetcalfe/u2gpd

Rewrite u2gpd in terms of qgpd