Add ExtensionConfigurationBuilder to manage add/remove/check all-role or named-role extension in the configuration. Plus a few other refactoring and fixes.