adds valgrind support to "make check" + fixes some invalid memory-access and some memory-leaks in sample-loading, tokenized-parser, regex-parser etc