PhEDEx improvement

Refactor the code to use WMBS as the source of information
instead of opening specs, this allows better accounting and
flexibility.

Summary of functionality changes:

- Clean up the SQLite code in PhEDEx, it is outdated and not supported.
- Add the Tier-0 support through the safeMode option.
- Check for duplicate dataset subscriptions before subscribing

Fixes #4479
Fixes #4480