Get rid of db dependencies on main

Conflicts:
	src/db.cpp
	src/wallet.h