Revive gitlab MR 297 by @mattwala
This revives (temporarily merged and then !309 (merged) reverted changes) from !297 (merged).
@mattwala, sorry for making a huge smouldering mess of this. As I said, I think this breaks sumpy. I'll start a test balloon MR there to check.
WIP until sumpy!108 (closed) passes unmodified.
Closes #152 (closed)
Edited by Matt Wala