Adds new valgrind testing code; to be improved!