copying deps src for rgrind
fixing memory leaks and simplifying tests