Fix #642: Refactor how store observers are pruned.