I made this for 10.6.X, but most of it still works on 10.7.X. However, there is lots more to do for 10.7.X, and I haven't had time to put into making a newer version. Meanwhile, feel free...
Here is the shell script. Please read through it first (a good idea):
Download it to (say) the desktop, and if the name offends, sorry, just rename it.
Then run it by opening the terminal into the directory where you downloaded it (Desktop or Downloads) and then issue the command:
Everything is undoable just by answering no (n).
You have to be an admin user, and some of the commands use "sudo" so you will have to supply your password. The shell script doesn't actually "see" the password, so it is safe.