Smart garbage collection to keep orphans (#15).
Remove incorrect solution from previous commit.
Note new unit test here.  All unit test pass.