Moving db into plugin, so plugins can access it directly from itself.