Wip 8231

This is rebased and can we can start reviewing this independently of the testing changes that follow.