Replace sqlite backend with tntdb one and add few features

Simplification of the architecture and move towards tntdb for database
backend. So far quite some extra functionality is broken but everything
miner needs work. Including storing checked and added time.