Added db init, cleaned up inter-module deps a little more.