Common completion data structure.

A bunch of latent bugfixes along the way.