Refactor email/domain whitelist checking, make it generic to all backends
Generic whitelist tests