agent: add global unit support to reconciler

Cruft left over - this was the first patch I started and it's been rebased about seven times in the past couple of days so it has some warts.