Another non-working commit with most of the rewrite complete but doesn't yet build.