Needs !237 (merged)
This hopefully helps memory leaks get noticed by cleaning up cruft and making structure simpler.