I always take pictures of the wiring. Or draw a diagram. Something to let me know exactly how everything was hooked up.
As for doing the rewire, I've always shut the system down at the breaker panel, completely, before I mess with the wiring.
And, I throw a couple of wraps of tape around the wiring bundle and tack it to the wall to make sure it doesn't drop back inside the wall cavity.