Backports fixes for legacy encoding checks and to not do any db lookups for the new membership providers and also ensures the legacy membership provider doesn't do any db lookups on init.