by justy: Refactored code as per PAReview
Issue #1315630 by andrewmacpherson, justy: Applied Patch to fix admin_theme_uninstall failing to invoke module hook.