Cleaned up batch inserter and graph db lifecycle management so that all tests ensure proper closing of db and files