Initial rewrite commit

Lots of major changes around making the framework less general and more fit for
purpose.