Gda cherry pick

Cherry-picking some stuff from the GDA fork, and cleaning up some stuff as I go.
WIP