add basic memleak tracking with valgrind
start using refcount for calcitems