Add tests for critical parts

Some functions allowing to interact with the database are quite critical and should be tested to prevent from regressions. A test set can be constructed in IPFS and used for the tests.