Add database setup file and refactor Makefile to run it and do a proper test in Valgrind