install/cleanup.py: Refactored run() function.