-Add some functions to clean up on exit to enable valgrind to be informative
-Fix main memory leak.. (above 3.5MB in 3 days)
Authored by: romexzf 2006-06-03
Parent: [r1105]
Child: [r1107]