Allow libraries to register privileges

Providers can then act upon these privileges. Some need to know which
privileges exist. (Including default)
Implement support for shared providers