Adding valgrind debug script.
Properly clear memory upon session exit.