Start with the "Clear device" function already found in Settings. It runs a script: /usr/sbin/osso-app-killer-cud.sh It doesn't clear everything (esp. settings in ~ by applications created by a 3rd-party, for instance) but it just runs a bunch of scripts in /etc/osso-cud-scripts/