Clean up shutdown procedures.

Take this out of DOCS-1862, which has gotten a lot of cruft that will otherwise cause merge issues.