Add cross test between registration and unregistration requests.
Refactor test.
Add test restore provider from preferences.
Minor fixes.