[feature/auth-refactor] Turn provider_db into a service

Removes globals from provider_db and turns it into a service.

PHPBB3-9734