That's pretty much the conclusion that I was arriving at.  I'll work on the reference-counting refactoring.  Should be doable independently of this PR and only require a minimal change here once it is done.