two improvements/fixes to rebuild script

1. actually remove case properties that are no longer relevant
2. don't "undelete" already deleted cases during rebuild