This also incorporates a bunch of other changes needed to support adding this.
Definitely still a work in progress