This reverts commit ac0fb59348. It causes valgrind errors which I'll want to investigate before resubmitting this.
ac0fb59348