Bug 334197 - [client] Clean up story for loading/initializing the service registry
diff --git a/bundles/org.eclipse.orion.client.core/web/compare/compare.js b/bundles/org.eclipse.orion.client.core/web/compare/compare.js
index f7d0880..4c7e9e3 100644
--- a/bundles/org.eclipse.orion.client.core/web/compare/compare.js
+++ b/bundles/org.eclipse.orion.client.core/web/compare/compare.js
@@ -10,20 +10,22 @@
 
 /*global define document */
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands',
+define(['dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands',
 		'orion/compare/compare-features', 'orion/compare/diff-provider', 'orion/compare/compare-container', 'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane'],
-		function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mFileClient, mSearchClient, mGlobalCommands, mCompareFeatures, mDiffProvider, mCompareContainer) {
+		function(dojo, mBootstrap, mStatus, mCommands, mFileClient, mSearchClient, mGlobalCommands, mCompareFeatures, mDiffProvider, mCompareContainer) {
 
-			dojo.addOnLoad(function() {
+		dojo.addOnLoad(function(){
+			mBootstrap.startup().then(function(core) {
+				var serviceRegistry = core.serviceRegistry;
+				var preferences = core.preferences;
+				
 				document.body.style.visibility = "visible";
 				dojo.parser.parse();
 				// initialize service registry and EAS services
-				var serviceRegistry = new mServiceregistry.ServiceRegistry();
-				var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
+
 				var commandService = new mCommands.CommandService({
 					serviceRegistry: serviceRegistry
 				});
-				var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
 				var searcher = new mSearchClient.Searcher({
 					serviceRegistry: serviceRegistry, commandService: commandService
 				});
@@ -31,7 +33,7 @@
 				var fileClient = new mFileClient.FileClient(serviceRegistry);
 				var diffProvider = new mDiffProvider.DiffProvider(serviceRegistry);
 
-				mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
+				mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
 				var uiFactory = new mCompareFeatures.CompareMergeUIFactory({
 					parentDivID: "compareContainer",
 					showTitle: true,
@@ -88,3 +90,4 @@
 				}
 			}
 		});
+});
diff --git a/bundles/org.eclipse.orion.client.core/web/edit/edit.js b/bundles/org.eclipse.orion.client.core/web/edit/edit.js
index e9f1da8..053f20b 100644
--- a/bundles/org.eclipse.orion.client.core/web/edit/edit.js
+++ b/bundles/org.eclipse.orion.client.core/web/edit/edit.js
@@ -9,11 +9,13 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 /*global define */
-define(['dojo','./setup'], function(dojo, mSetup) {
-	
+define(['dojo','orion/bootstrap', './setup'], function(dojo, mBootstrap, mSetup) {
 	dojo.addOnLoad(function(){
-		mSetup.setUpEditor(false);  // not read only
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			mSetup.setUpEditor(serviceRegistry, preferences, false);  // not read only
+		});
 	});
-
 });
 
diff --git a/bundles/org.eclipse.orion.client.core/web/edit/readonly.js b/bundles/org.eclipse.orion.client.core/web/edit/readonly.js
index 39eaf16..c840a0d 100644
--- a/bundles/org.eclipse.orion.client.core/web/edit/readonly.js
+++ b/bundles/org.eclipse.orion.client.core/web/edit/readonly.js
@@ -11,9 +11,11 @@
 /*global define */
 
 define(['dojo','./setup'], function(dojo, mSetup) {
-	
 	dojo.addOnLoad(function(){
-		mSetup.setUpEditor(true);  // not read only
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			mSetup.setUpEditor(serviceRegistry, preferences, true);  // read only
+		});
 	});
-
 });
diff --git a/bundles/org.eclipse.orion.client.core/web/edit/setup.js b/bundles/org.eclipse.orion.client.core/web/edit/setup.js
index 1a97373..cbbe289 100644
--- a/bundles/org.eclipse.orion.client.core/web/edit/setup.js
+++ b/bundles/org.eclipse.orion.client.core/web/edit/setup.js
@@ -11,24 +11,21 @@
 /*jslint browser:true devel:true*/
 /*global define eclipse:true orion:true dojo dijit window*/
 
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/selection', 'orion/status', 'orion/dialogs',
+define(['require', 'dojo', 'orion/selection', 'orion/status', 'orion/dialogs',
         'orion/commands', 'orion/util', 'orion/favorites', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands', 'orion/outliner',
         'orion/problems', 'orion/editor/contentAssist', 'orion/editorCommands', 'orion/editor/editorFeatures', 'orion/editor/editor', 'orion/syntaxchecker',
         'orion/editor/textMateStyler', 'orion/breadcrumbs', 'examples/textview/textStyler', 'orion/textview/textView', 'orion/textview/textModel', 
         'orion/textview/projectionTextModel', 'orion/textview/keyBinding','orion/searchAndReplace/textSearcher','orion/searchAndReplace/orionTextSearchAdaptor',
         'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'], 
-		function(require, dojo, mServiceregistry, mPreferences, mPluginRegistry, mSelection, mStatus, mDialogs, mCommands, mUtil, mFavorites,
+		function(require, dojo, mSelection, mStatus, mDialogs, mCommands, mUtil, mFavorites,
 				mFileClient, mSearchClient, mGlobalCommands, mOutliner, mProblems, mContentAssist, mEditorCommands, mEditorFeatures, mEditor,
 				mSyntaxchecker, mTextMateStyler, mBreadcrumbs, mTextStyler, mTextView, mTextModel, mProjectionTextModel, mKeyBinding, mSearcher, mSearchAdaptor) {
 	
 var exports = exports || {};
 	
-exports.setUpEditor = function(isReadOnly){
-	var pluginRegistry = null;
-	var serviceRegistry = null;
+exports.setUpEditor = function(serviceRegistry, preferences, isReadOnly){
 	var document = window.document;
 	var selection;
-	var prefsService;
 	var commandService;
 	var statusReportingService;
 	var problemService;
@@ -39,22 +36,14 @@
 	
 	// Initialize the plugin registry
 	(function() {
-		// This is the new service registry.  All services should be registered and obtained here.
-		serviceRegistry = new mServiceregistry.ServiceRegistry();
-		pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		
 		selection = new mSelection.Selection(serviceRegistry);
 		statusReportingService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
 		new mDialogs.DialogService(serviceRegistry);
-		prefsService = new mPreferences.PreferencesService(serviceRegistry);
 		commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry, selection: selection});
 
 		// Editor needs additional services besides EAS.
 		problemService = new mProblems.ProblemService(serviceRegistry);
-		outlineService = new mOutliner.OutlineService({serviceRegistry: serviceRegistry, preferencesService: prefsService});
+		outlineService = new mOutliner.OutlineService({serviceRegistry: serviceRegistry, preferences: preferences});
 		new mFavorites.FavoritesService({serviceRegistry: serviceRegistry});
 	}());
 	
@@ -469,7 +458,7 @@
 	inputManager.setInput(dojo.hash(), editor);
 	
 	// TODO search location needs to be gotten from somewhere
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, prefsService, searcher, editor, editor, escHandler);
+	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, editor, editor, escHandler);
 	mGlobalCommands.generateDomCommandsInBanner(commandService, editor);
 		
 	var syntaxChecker = new mSyntaxchecker.SyntaxChecker(serviceRegistry, editor);
diff --git a/bundles/org.eclipse.orion.client.core/web/index.js b/bundles/org.eclipse.orion.client.core/web/index.js
index 7af9fdb..d4d4fc1 100644
--- a/bundles/org.eclipse.orion.client.core/web/index.js
+++ b/bundles/org.eclipse.orion.client.core/web/index.js
@@ -11,108 +11,95 @@
 /*jslint browser:true devel:true*/
 /*global define*/
 
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/commands', 'orion/searchClient', 'orion/status', 'orion/globalCommands',
+define(['require', 'dojo', 'orion/bootstrap', 'orion/commands', 'orion/searchClient', 'orion/status', 'orion/globalCommands',
         'dojo/parser', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane'/*, 'dojox/widget/Portlet', 'dojox/widget/FeedPortlet'*/], 
-		function(require, dojo, mServiceregistry, mPreferences, mPluginRegistry, mCommands, mSearchClient, mStatus, mGlobalCommands) {
+		function(require, dojo, mBootstrap, mCommands, mSearchClient, mStatus, mGlobalCommands) {
 
-dojo.addOnLoad(function() {
-
-	// initialize service registry and EAS services
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-
-	// This is code to ensure the first visit to orion works
-	// we read settings and wait for the plugin registry to fully startup before continuing
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var pluginRegistry;
-	preferenceService.getPreferences("/plugins").then(function() {
-		pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		return pluginRegistry.startup();
-	}).then(function() {
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+	dojo.addOnLoad(function() {
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+				
+			// global commands
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
 			
-		// global commands
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
-		
-		// Populate recent projects
-		serviceRegistry.getService("orion.core.preference").then(function(service) {
-				return service.getPreferences("/window/recent");
-			}).then(function(prefs){
-				var projects =  prefs.get("projects");
-				if (typeof projects === "string") {
-					projects = JSON.parse(projects);
-				}
-				var recent = dojo.byId("recent");
-				dojo.empty(recent);
-				if (projects && projects.length && projects.length > 0) {
-					for (var i=projects.length-1; i>=0; i--) {
-						if (projects[i].location && projects[i].name) {
-							dojo.place("<a class='landingLink' href='" + require.toUrl("navigate/table.html") + "#" + projects[i].location+"'>"+projects[i].name+"</a><br>", recent, "last");
-						}
+			// Populate recent projects
+			serviceRegistry.getService("orion.core.preference").then(function(service) {
+					return service.getPreferences("/window/recent");
+				}).then(function(prefs){
+					var projects =  prefs.get("projects");
+					if (typeof projects === "string") {
+						projects = JSON.parse(projects);
 					}
-				} else {
-					dojo.place("<div>Go to the <a href='" + require.toUrl("navigate/table.html") + "#'>Navigator</a> to create or view your projects.</div>", recent, "only");
-				}
-			});
-		
-		// Populate the "get started" tasks
-		
-		// Note that the shape of the "orion.help.task" extension is not in any shape or form that could be considered final.
-		// We've included it to enable experimentation. Please provide feedback on IRC or bugzilla.
-		
-		// The shape of the contributed tasks is (for now):
-		// info - information about the tasks (object).
-		//		required attribute: name - the name of the task
-		//		required attribute: id - the id of the task
-		//		required attribute: image - a URL to an image (preferably 40x40, this could change)
-		//		required attribute: description - a description of the task
-		//	    required attribute: steps - an array of steps (array).
-		//             optional attribute: href.  An href that takes the user to the page described in the step
-		//             required attribute: description of the step.  May be manual instructions for the user.  Appears after the href.
-		var taskReferences = serviceRegistry.getServiceReferences("orion.help.task");
-		var taskParent = dojo.byId("tasks");
-		var taskTable = dojo.create("table", null, taskParent, "only");
-		for (var i=0; i<taskReferences.length; i++) {
-			serviceRegistry.getService(taskReferences[i]).then(function(service) {
-				var info = {};
-				var propertyNames = taskReferences[i].getPropertyNames();
-				for (var j = 0; j < propertyNames.length; j++) {
-					info[propertyNames[j]] = taskReferences[i].getProperty(propertyNames[j]);
-				}
-				var row = dojo.create("tr", null, taskTable, "last");
-				var iconCol = dojo.create("td", null, row, "last");
-				var img = dojo.create("img", {src: info.image, name: info.name, alt: info.name}, iconCol, "only");
-				dojo.addClass(img, "landingImage");
-				var descriptionCol = dojo.create("td", null, row, "last");
-				dojo.addClass(descriptionCol, "landingDescription");
-				dojo.place(document.createTextNode(info.description), descriptionCol, "only");
-				var stepsRow = dojo.create("tr", null, taskTable, "last");
-				var stepsCol = dojo.create("td", {colspan: "2"}, stepsRow, "last");
-				var stepsList = dojo.create("ul", null, stepsCol, "last");
-				for (var k=0; k<info.steps.length; k++) {
-					var item = dojo.create("li", null, stepsList, "last");
-					dojo.place(document.createTextNode(info.steps[k].description), item, "last");
-					if (info.steps[k].href) {
-						dojo.create("br", null, item);
-						var anchor = dojo.create("a", {href: info.steps[k].href}, item, "last");
-						dojo.addClass(anchor, "landingLink");
-						if (info.steps[k].linkName) {
-							dojo.place(document.createTextNode("Go to " + info.steps[k].linkName + "."), anchor, "only");
-						} else {
-							dojo.place(document.createTextNode("Go to " + info.steps[k].href + "."), anchor, "only");
+					var recent = dojo.byId("recent");
+					dojo.empty(recent);
+					if (projects && projects.length && projects.length > 0) {
+						for (var i=projects.length-1; i>=0; i--) {
+							if (projects[i].location && projects[i].name) {
+								dojo.place("<a class='landingLink' href='" + require.toUrl("navigate/table.html") + "#" + projects[i].location+"'>"+projects[i].name+"</a><br>", recent, "last");
+							}
 						}
+					} else {
+						dojo.place("<div>Go to the <a href='" + require.toUrl("navigate/table.html") + "#'>Navigator</a> to create or view your projects.</div>", recent, "only");
 					}
-	
-				}
-			});
-		}
-		document.body.style.visibility = "visible";
-		dojo.parser.parse();
+				});
+			
+			// Populate the "get started" tasks
+			
+			// Note that the shape of the "orion.help.task" extension is not in any shape or form that could be considered final.
+			// We've included it to enable experimentation. Please provide feedback on IRC or bugzilla.
+			
+			// The shape of the contributed tasks is (for now):
+			// info - information about the tasks (object).
+			//		required attribute: name - the name of the task
+			//		required attribute: id - the id of the task
+			//		required attribute: image - a URL to an image (preferably 40x40, this could change)
+			//		required attribute: description - a description of the task
+			//	    required attribute: steps - an array of steps (array).
+			//             optional attribute: href.  An href that takes the user to the page described in the step
+			//             required attribute: description of the step.  May be manual instructions for the user.  Appears after the href.
+			var taskReferences = serviceRegistry.getServiceReferences("orion.help.task");
+			var taskParent = dojo.byId("tasks");
+			var taskTable = dojo.create("table", null, taskParent, "only");
+			for (var i=0; i<taskReferences.length; i++) {
+				serviceRegistry.getService(taskReferences[i]).then(function(service) {
+					var info = {};
+					var propertyNames = taskReferences[i].getPropertyNames();
+					for (var j = 0; j < propertyNames.length; j++) {
+						info[propertyNames[j]] = taskReferences[i].getProperty(propertyNames[j]);
+					}
+					var row = dojo.create("tr", null, taskTable, "last");
+					var iconCol = dojo.create("td", null, row, "last");
+					var img = dojo.create("img", {src: info.image, name: info.name, alt: info.name}, iconCol, "only");
+					dojo.addClass(img, "landingImage");
+					var descriptionCol = dojo.create("td", null, row, "last");
+					dojo.addClass(descriptionCol, "landingDescription");
+					dojo.place(document.createTextNode(info.description), descriptionCol, "only");
+					var stepsRow = dojo.create("tr", null, taskTable, "last");
+					var stepsCol = dojo.create("td", {colspan: "2"}, stepsRow, "last");
+					var stepsList = dojo.create("ul", null, stepsCol, "last");
+					for (var k=0; k<info.steps.length; k++) {
+						var item = dojo.create("li", null, stepsList, "last");
+						dojo.place(document.createTextNode(info.steps[k].description), item, "last");
+						if (info.steps[k].href) {
+							dojo.create("br", null, item);
+							var anchor = dojo.create("a", {href: info.steps[k].href}, item, "last");
+							dojo.addClass(anchor, "landingLink");
+							if (info.steps[k].linkName) {
+								dojo.place(document.createTextNode("Go to " + info.steps[k].linkName + "."), anchor, "only");
+							} else {
+								dojo.place(document.createTextNode("Go to " + info.steps[k].href + "."), anchor, "only");
+							}
+						}
+		
+					}
+				});
+			}
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
+		});
 	});
 });
-
-});
diff --git a/bundles/org.eclipse.orion.client.core/web/navigate/table.js b/bundles/org.eclipse.orion.client.core/web/navigate/table.js
index b25ed17..e6b6be9 100644
--- a/bundles/org.eclipse.orion.client.core/web/navigate/table.js
+++ b/bundles/org.eclipse.orion.client.core/web/navigate/table.js
@@ -11,32 +11,17 @@
 /*global define document dojo dijit window eclipse orion serviceRegistry:true widgets alert*/
 /*browser:true*/
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/selection', 'orion/status', 'orion/dialogs',
+define(['dojo', 'orion/bootstrap', 'orion/selection', 'orion/status', 'orion/dialogs',
         'orion/ssh/sshTools', 'orion/commands', 'orion/favorites', 'orion/searchClient', 'orion/fileClient', 'orion/globalCommands',
         'orion/fileCommands', 'orion/explorer-table', 'orion/util',
         'dojo/parser', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'], 
-		function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mSelection, mStatus, mDialogs, mSsh, mCommands, mFavorites, 
+		function(dojo, mBootstrap, mSelection, mStatus, mDialogs, mSsh, mCommands, mFavorites, 
 				mSearchClient, mFileClient, mGlobalCommands, mFileCommands, mExplorerTable, mUtil) {
 
-
-
 dojo.addOnLoad(function(){
-
-	
-	// initialize service registry and EAS services
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-
-	// This is code to ensure the first visit to orion works
-	// we read settings and wait for the plugin registry to fully startup before continuing
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var pluginRegistry;
-	preferenceService.getPreferences("/plugins").then(function() {
-		pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		return pluginRegistry.startup();
-	}).then(function() {
+	mBootstrap.startup().then(function(core) {
+		var serviceRegistry = core.serviceRegistry;
+		var preferences = core.preferences;
 		var selection = new mSelection.Selection(serviceRegistry);		
 		new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
 		new mDialogs.DialogService(serviceRegistry);
@@ -76,7 +61,7 @@
 		var splitArea = dijit.byId("orion.innerNavigator");
 				
 		// global commands
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher, explorer);
+		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, explorer);
 		// commands shared by navigators
 		mFileCommands.createFileCommands(serviceRegistry, commandService, explorer, fileClient, "pageActions", "selectionTools");
 		
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/bootstrap.js b/bundles/org.eclipse.orion.client.core/web/orion/bootstrap.js
new file mode 100644
index 0000000..c06ed98
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.core/web/orion/bootstrap.js
@@ -0,0 +1,38 @@
+/*******************************************************************************

+ * Copyright (c) 2011 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials are made 

+ * available under the terms of the Eclipse Public License v1.0 

+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 

+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+/*global define document dojo dijit window eclipse orion serviceRegistry:true widgets alert*/

+/*browser:true*/

+

+define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry'], function(dojo, mServiceregistry, mPreferences, mPluginRegistry) {

+	function startup() {

+		// initialize service registry and EAS services

+		var serviceRegistry = new mServiceregistry.ServiceRegistry();

+	

+		// This is code to ensure the first visit to orion works

+		// we read settings and wait for the plugin registry to fully startup before continuing

+		var preferences = new mPreferences.PreferencesService(serviceRegistry);

+		var pluginRegistry;

+		return preferences.getPreferences("/plugins").then(function() {

+			pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);

+			dojo.addOnWindowUnload(function() {

+				pluginRegistry.shutdown();

+			});

+			return pluginRegistry.startup();

+		}).then(function() {

+			return {

+				serviceRegistry: serviceRegistry,

+				preferences: preferences,

+				pluginRegistry: pluginRegistry

+			};

+		});

+	}

+	return {startup: startup};

+});

diff --git a/bundles/org.eclipse.orion.client.core/web/orion/outliner.js b/bundles/org.eclipse.orion.client.core/web/orion/outliner.js
index e4032c7..bd7eba2 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/outliner.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/outliner.js
@@ -178,13 +178,13 @@
 	 * Clients may listen to the service's <code>outline</code> event to receive notification when this occurs.
 	 * @param {orion.serviceregistry.ServiceRegistry} options.serviceRegistry The service registry to use for obtaining
 	 * outline providers.
-	 * @param {orion.preferences.PreferencesService} options.preferencesService The preferences service to use.
+	 * @param {orion.preferences.PreferencesService} options.preferences The preferences service to use.
 	 */
 	function OutlineService(options) {
 		this._serviceRegistry = options.serviceRegistry;
-		this._preferencesService = options.preferencesService;
+		this._preferences = options.preferences;
 		this._serviceRegistration = this._serviceRegistry.registerService("orion.edit.outline", this);
-		this._outlinePref = this._preferencesService.getPreferences("/edit/outline");
+		this._outlinePref = this._preferences.getPreferences("/edit/outline");
 	}
 	OutlineService.prototype = /** @lends orion.outliner.OutlineService.prototype */ {
 		setOutlineProviders: function(/**ServiceReference[]*/ providers, contents, title) {
diff --git a/bundles/org.eclipse.orion.client.core/web/plugin/install.js b/bundles/org.eclipse.orion.client.core/web/plugin/install.js
index ea6042e..b47a61a 100644
--- a/bundles/org.eclipse.orion.client.core/web/plugin/install.js
+++ b/bundles/org.eclipse.orion.client.core/web/plugin/install.js
@@ -11,61 +11,59 @@
 /*jslint browser:true devel:true*/
 /*global dijit dojo eclipse widgets serviceRegistry:true*/
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 
+define(['dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 
 	        'orion/searchClient', 'orion/globalCommands',
 	        'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane'], 
-			function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mSearchClient, mGlobalCommands) {
+			function(dojo, mBootstrap, mStatus, mCommands, mSearchClient, mGlobalCommands) {
 
-dojo.addOnLoad(function() {
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
-	
-	// TODO get the registry from somewhere else
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-	var registry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-	dojo.addOnWindowUnload(function() {
-		registry.shutdown();
-	});
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-	var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-	var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+	dojo.addOnLoad(function() {
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			var pluginRegistry = core.pluginRegistry;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
+			
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+				
+			// global commands
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
 		
-	// global commands
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
-
-	var pluginUrl = dojo.hash();
-	if(pluginUrl) {
-		dojo.byId("valid-hash").style.display = "block";
-		dojo.place(window.document.createTextNode(pluginUrl), "plugin-location", "only");
-		
-		dojo.connect(dojo.byId("install"), "click", function(evt) {
-			dojo.byId("valid-hash").style.display = "none";
-			dojo.byId("wait").style.display = "block";
-			registry.installPlugin(pluginUrl).then(
-				function(plugin) {
-					dojo.byId("wait").style.display = "none";
-					dojo.byId("success").style.display = "block";
-					statusService.setMessage("Installed " + plugin.getLocation(), 5000);
-					preferenceService.getPreferences("/plugins").then(function(plugins) {
-						plugins.flush();
-					}); // this will force a sync 
-					var metadata = plugin.getData().metadata;
-					if (metadata) {
-						if (metadata.postInstallUrl) {
-							window.location.href = metadata.postInstallUrl;
-						}
-					}
-				}, function(error) {
-					dojo.byId("wait").style.display = "none";
-					dojo.byId("failure").style.display = "block";
-					dojo.place(window.document.createTextNode(error), "problem", "only");
-					statusService.setErrorMessage(error);
+			var pluginUrl = dojo.hash();
+			if(pluginUrl) {
+				dojo.byId("valid-hash").style.display = "block";
+				dojo.place(window.document.createTextNode(pluginUrl), "plugin-location", "only");
+				
+				dojo.connect(dojo.byId("install"), "click", function(evt) {
+					dojo.byId("valid-hash").style.display = "none";
+					dojo.byId("wait").style.display = "block";
+					pluginRegistry.installPlugin(pluginUrl).then(
+						function(plugin) {
+							dojo.byId("wait").style.display = "none";
+							dojo.byId("success").style.display = "block";
+							statusService.setMessage("Installed " + plugin.getLocation(), 5000);
+							preferences.getPreferences("/plugins").then(function(plugins) {
+								plugins.flush();
+							}); // this will force a sync 
+							var metadata = plugin.getData().metadata;
+							if (metadata) {
+								if (metadata.postInstallUrl) {
+									window.location.href = metadata.postInstallUrl;
+								}
+							}
+						}, function(error) {
+							dojo.byId("wait").style.display = "none";
+							dojo.byId("failure").style.display = "block";
+							dojo.place(window.document.createTextNode(error), "problem", "only");
+							statusService.setErrorMessage(error);
+						});
 				});
+			} else {
+				dojo.byId("invalid-hash").style.display = "block";
+			}
 		});
-	} else {
-		dojo.byId("invalid-hash").style.display = "block";
-	}
-});
-
+	
+	});
 });
diff --git a/bundles/org.eclipse.orion.client.core/web/plugin/list.js b/bundles/org.eclipse.orion.client.core/web/plugin/list.js
index 53fc38f..b63e79c 100644
--- a/bundles/org.eclipse.orion.client.core/web/plugin/list.js
+++ b/bundles/org.eclipse.orion.client.core/web/plugin/list.js
@@ -11,29 +11,19 @@
 /*jslint browser:true devel:true*/
 /*global dijit dojo orion widgets serviceRegistry:true window*/
 
-
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 
+define(['dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 
 	        'orion/searchClient', 'orion/globalCommands', 'orion/dialogs',
 	        'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/RegistryTree'], 
-			function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mSearchClient, mGlobalCommands, mDialogs) {
+			function(dojo, mBootstrap, mStatus, mCommands, mSearchClient, mGlobalCommands, mDialogs) {
 
 dojo.addOnLoad(function() {
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
-
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-	// This is code to ensure the first visit to orion works
-	// we read settings and wait for the plugin registry to fully startup before continuing
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var dialogService = new mDialogs.DialogService(serviceRegistry);
-	var pluginRegistry;
-	preferenceService.getPreferences("/plugins").then(function() {
-		pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		return pluginRegistry.startup();
-	}).then(function() {
+	mBootstrap.startup().then(function(core) {
+		var serviceRegistry = core.serviceRegistry;
+		var preferences = core.preferences;
+		var pluginRegistry = core.pluginRegistry;
+		document.body.style.visibility = "visible";
+		dojo.parser.parse();
+		var dialogService = new mDialogs.DialogService(serviceRegistry);
 		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
 		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
 		var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
@@ -45,7 +35,7 @@
 		};
 		
 		// global commands
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
+		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
 	
 		// add install stuff to page actions toolbar
 		// We could use the command framework for the links but we are being lazy since we have to add a textbox anyway
@@ -89,7 +79,7 @@
 						initTree();
 						installUrlTextBox.value="";
 						statusService.setMessage("Installed " + plugin.getLocation(), 5000);
-						preferenceService.getPreferences("/plugins").then(function(plugins) {
+						preferences.getPreferences("/plugins").then(function(plugins) {
 							plugins.flush();
 						}); // this will force a sync
 					}, function(error) {
@@ -136,7 +126,7 @@
 				initTree();
 				// report what we uninstalled so it's easy for user to copy/paste a plugin that they want back
 				statusService.setMessage("Uninstalled " + message, 5000);
-				preferenceService.getPreferences("/plugins").then(function(plugins) {
+				preferences.getPreferences("/plugins").then(function(plugins) {
 					plugins.flush();
 				}); // this will force a sync
 			});
diff --git a/bundles/org.eclipse.orion.client.core/web/search/search.js b/bundles/org.eclipse.orion.client.core/web/search/search.js
index d3d49ba..ecd4f6e 100644
--- a/bundles/org.eclipse.orion.client.core/web/search/search.js
+++ b/bundles/org.eclipse.orion.client.core/web/search/search.js
@@ -11,47 +11,38 @@
 /*global window define */
 /*browser:true*/
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status','orion/dialogs',
+define(['dojo', 'orion/bootstrap', 'orion/status','orion/dialogs',
         'orion/commands', 'orion/favorites', 'orion/searchClient', 'orion/searchResults', 'orion/globalCommands',
         'dojo/parser', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'], 
-		function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mDialogs, mCommands, mFavorites, 
+		function(dojo, mBootstrap, mStatus, mDialogs, mCommands, mFavorites, 
 				mSearchClient, mSearchResults, mGlobalCommands) {
 
-dojo.addOnLoad(function(){
-	window.document.body.style.visibility = "visible";
-	dojo.parser.parse();
+	dojo.addOnLoad(function() {
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			window.document.body.style.visibility = "visible";
+			dojo.parser.parse();
 
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-	// This is code to ensure the first visit to orion works
-	// we read settings and wait for the plugin registry to fully startup before continuing
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var dialogService = new mDialogs.DialogService(serviceRegistry);
-	var pluginRegistry;
-	preferenceService.getPreferences("/plugins").then(function() {
-		pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		return pluginRegistry.startup();
-	}).then(function() {
-		new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-
-		// Favorites
-		new mFavorites.FavoritesService({serviceRegistry: serviceRegistry});
+			var dialogService = new mDialogs.DialogService(serviceRegistry);
+			new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
 	
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		var searchResultsGenerator = new mSearchResults.SearchResultsGenerator(serviceRegistry, searcher, "results", commandService, "pageActions");
-		var favorites = new mFavorites.Favorites({parent: "favoriteProgress", serviceRegistry: serviceRegistry});
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher, searcher);
-		searchResultsGenerator.loadResults(dojo.hash());
-		mGlobalCommands.generateDomCommandsInBanner(commandService, searcher, "pageActions");
-	
-		//every time the user manually changes the hash, we need to load the results with that name
-		dojo.subscribe("/dojo/hashchange", searchResultsGenerator, function() {
-		   searchResultsGenerator.loadResults(dojo.hash());
-			mGlobalCommands.generateDomCommandsInBanner(commandService, searcher, "pageActions");   
+			// Favorites
+			new mFavorites.FavoritesService({serviceRegistry: serviceRegistry});
+		
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			var searchResultsGenerator = new mSearchResults.SearchResultsGenerator(serviceRegistry, searcher, "results", commandService, "pageActions");
+			var favorites = new mFavorites.Favorites({parent: "favoriteProgress", serviceRegistry: serviceRegistry});
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, searcher);
+			searchResultsGenerator.loadResults(dojo.hash());
+			mGlobalCommands.generateDomCommandsInBanner(commandService, searcher, "pageActions");
+		
+			//every time the user manually changes the hash, we need to load the results with that name
+			dojo.subscribe("/dojo/hashchange", searchResultsGenerator, function() {
+			   searchResultsGenerator.loadResults(dojo.hash());
+				mGlobalCommands.generateDomCommandsInBanner(commandService, searcher, "pageActions");   
+			});
 		});
 	});
-});
 });
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/sites/site.js b/bundles/org.eclipse.orion.client.core/web/sites/site.js
index b556f3a..f9c7fa1 100644
--- a/bundles/org.eclipse.orion.client.core/web/sites/site.js
+++ b/bundles/org.eclipse.orion.client.core/web/sites/site.js
@@ -14,91 +14,89 @@
 /*
  * Glue code for site.html
  */
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 
+define(['dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 
 	        'orion/fileClient', 'orion/searchClient', 'orion/dialogs', 'orion/globalCommands', 'orion/siteService', 'orion/siteUtils', 'orion/siteTree', 'orion/treetable', 
 	        'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/SiteEditor'], 
-			function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mFileClient, mSearchClient, mDialogs, mGlobalCommands, mSiteService, mSiteUtils, mSiteTree, mTreeTable) {
+			function(dojo, mBootstrap, mStatus, mCommands, mFileClient, mSearchClient, mDialogs, mGlobalCommands, mSiteService, mSiteUtils, mSiteTree, mTreeTable) {
 
 	dojo.addOnLoad(function() {
-		document.body.style.visibility = "visible";
-		dojo.parser.parse();
-		
-		// Register services
-		var serviceRegistry = new mServiceregistry.ServiceRegistry();
-		var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		var dialogService = new mDialogs.DialogService(serviceRegistry);
-		var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-	
-		var fileClient = new mFileClient.FileClient(serviceRegistry, function(reference) {
-			var pattern = reference.getProperty("pattern");
-			return pattern && pattern.indexOf("/") === 0;
-		});
-		var siteService = new mSiteService.SiteService(serviceRegistry);
-		var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
-		
-		var updateTitle = function() {
-			var editor = dijit.byId("site-editor");
-			var site = editor && editor.getSiteConfiguration();
-			if (editor && site) {
-				var location = dojo.byId("location");
-				dojo.place(document.createTextNode(site.Name), location, "only");
-				document.title = site.Name + (editor.isDirty() ? "* " : "") + " - Edit Site";
-			}
-		};
-		
-		var onHashChange = function() {
-			var hash = dojo.hash();
-			var state = mSiteUtils.parseStateFromHash(hash);
-			var editor = dijit.byId("site-editor");
-			if (state.site /* && site is not already loaded */) {
-				editor.load(state.site).then(
-					function() {
-						updateTitle();
-					});
-			}
-		};
-		dojo.subscribe("/dojo/hashchange", null, onHashChange);
-		
-		// Initialize the widget
-		var widget;
-		(function() {
-			widget = new orion.widgets.SiteEditor({
-				serviceRegistry: serviceRegistry,
-				fileClient: fileClient,
-				siteService: siteService,
-				commandService: commandService,
-				statusService: statusService,
-				commandsContainer: dojo.byId("pageActions"),
-				id: "site-editor"});
-			dojo.place(widget.domNode, dojo.byId("site"), "only");
-			widget.startup();
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
 			
-			dojo.connect(widget, "onSuccess", updateTitle);
-			dojo.connect(widget, "setDirty", updateTitle);
+			// Register services
+			var dialogService = new mDialogs.DialogService(serviceRegistry);
+			var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+		
+			var fileClient = new mFileClient.FileClient(serviceRegistry, function(reference) {
+				var pattern = reference.getProperty("pattern");
+				return pattern && pattern.indexOf("/") === 0;
+			});
+			var siteService = new mSiteService.SiteService(serviceRegistry);
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
 			
-			onHashChange();
-		}());
-		
-		window.onbeforeunload = function() {
-			if (widget.isDirty()) {
-				return "There are unsaved changes.";
-			}
-		};
-		
-		// Hook up commands stuff
-		var refresher = dojo.hitch(widget, widget._setSiteConfiguration);
-		var errorHandler = dojo.hitch(statusService, statusService.setProgressResult);
-		
-		mSiteUtils.createSiteCommands(commandService, siteService, statusService, dialogService, 
-				/*start*/ refresher, /*stop*/ refresher, /*delete*/ null, errorHandler);
-		commandService.registerCommandContribution("eclipse.site.start", 1);
-		commandService.registerCommandContribution("eclipse.site.stop", 2);
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
+			
+			var updateTitle = function() {
+				var editor = dijit.byId("site-editor");
+				var site = editor && editor.getSiteConfiguration();
+				if (editor && site) {
+					var location = dojo.byId("location");
+					dojo.place(document.createTextNode(site.Name), location, "only");
+					document.title = site.Name + (editor.isDirty() ? "* " : "") + " - Edit Site";
+				}
+			};
+			
+			var onHashChange = function() {
+				var hash = dojo.hash();
+				var state = mSiteUtils.parseStateFromHash(hash);
+				var editor = dijit.byId("site-editor");
+				if (state.site /* && site is not already loaded */) {
+					editor.load(state.site).then(
+						function() {
+							updateTitle();
+						});
+				}
+			};
+			dojo.subscribe("/dojo/hashchange", null, onHashChange);
+			
+			// Initialize the widget
+			var widget;
+			(function() {
+				widget = new orion.widgets.SiteEditor({
+					serviceRegistry: serviceRegistry,
+					fileClient: fileClient,
+					siteService: siteService,
+					commandService: commandService,
+					statusService: statusService,
+					commandsContainer: dojo.byId("pageActions"),
+					id: "site-editor"});
+				dojo.place(widget.domNode, dojo.byId("site"), "only");
+				widget.startup();
+				
+				dojo.connect(widget, "onSuccess", updateTitle);
+				dojo.connect(widget, "setDirty", updateTitle);
+				
+				onHashChange();
+			}());
+			
+			window.onbeforeunload = function() {
+				if (widget.isDirty()) {
+					return "There are unsaved changes.";
+				}
+			};
+			
+			// Hook up commands stuff
+			var refresher = dojo.hitch(widget, widget._setSiteConfiguration);
+			var errorHandler = dojo.hitch(statusService, statusService.setProgressResult);
+			
+			mSiteUtils.createSiteCommands(commandService, siteService, statusService, dialogService, 
+					/*start*/ refresher, /*stop*/ refresher, /*delete*/ null, errorHandler);
+			commandService.registerCommandContribution("eclipse.site.start", 1);
+			commandService.registerCommandContribution("eclipse.site.stop", 2);
+		});
 	});
 });
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/sites/sites.js b/bundles/org.eclipse.orion.client.core/web/sites/sites.js
index 2b5470d..ccf3946 100644
--- a/bundles/org.eclipse.orion.client.core/web/sites/sites.js
+++ b/bundles/org.eclipse.orion.client.core/web/sites/sites.js
@@ -15,91 +15,89 @@
  * Glue code for sites.html
  */
 
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 
+define(['require', 'dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 
 	        'orion/searchClient', 'orion/dialogs', 'orion/globalCommands', 'orion/siteService', 'orion/siteUtils', 'orion/siteTree', 'orion/treetable', 
 	        'dojo/parser', 'dojo/hash', 'dojo/date/locale', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/NewSiteDialog'], 
-			function(require, dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mSearchClient, mDialogs, mGlobalCommands, mSiteService, mSiteUtils, mSiteTree, mTreeTable) {
+			function(require, dojo, mBootstrap, mStatus, mCommands, mSearchClient, mDialogs, mGlobalCommands, mSiteService, mSiteUtils, mSiteTree, mTreeTable) {
 
 	dojo.addOnLoad(function() {
-		document.body.style.visibility = "visible";
-		dojo.parser.parse();
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
+		
+			// Register services
+			var dialogService = new mDialogs.DialogService(serviceRegistry);
+			var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
 	
-		// Register services
-		var serviceRegistry = new mServiceregistry.ServiceRegistry();
-		var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnWindowUnload(function() {
-			pluginRegistry.shutdown();
-		});
-		var dialogService = new mDialogs.DialogService(serviceRegistry);
-		var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-
-		var siteService = new mSiteService.SiteService(serviceRegistry);
-		var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
-		
-		// Create the visuals
-		var model;
-		var treeWidget;
-		(function() {
-			statusService.setMessage("Loading...");
-			var renderer = new mSiteTree.SiteRenderer(commandService);
-			dojo.connect(renderer, "rowsChanged", null, function() {
-				statusService.setMessage("");
-			});
-			treeWidget = new mTreeTable.TableTree({
-				id: "site-table-tree",
-				parent: dojo.byId("site-table"),
-				model: new mSiteTree.SiteTreeModel(siteService, "site-table-tree"),
-				showRoot: false,
-				renderer: renderer
-			});
-		}());
-		
-		(function() {
-			// Reloads the table view after doing a command
-			var refresher = function() {
-				siteService.getSiteConfigurations().then(function(siteConfigs) {
+			var siteService = new mSiteService.SiteService(serviceRegistry);
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
+			
+			// Create the visuals
+			var model;
+			var treeWidget;
+			(function() {
+				statusService.setMessage("Loading...");
+				var renderer = new mSiteTree.SiteRenderer(commandService);
+				dojo.connect(renderer, "rowsChanged", null, function() {
 					statusService.setMessage("");
-					treeWidget.refreshAndExpand("site-table-tree", siteConfigs);
 				});
-			};
-			var errorHandler = dojo.hitch(statusService, statusService.setProgressResult);
+				treeWidget = new mTreeTable.TableTree({
+					id: "site-table-tree",
+					parent: dojo.byId("site-table"),
+					model: new mSiteTree.SiteTreeModel(siteService, "site-table-tree"),
+					showRoot: false,
+					renderer: renderer
+				});
+			}());
 			
-			var createCommand = new mCommands.Command({
-				name : "Create Site",
-				tooltip: "Create a new site configuration",
-				image : require.toUrl("images/add.gif"),
-				id: "eclipse.sites.create",
-				groupId: "eclipse.sitesGroup",
-				callback : function() {
-					var dialog = new orion.widgets.NewSiteDialog({
-						title: "Create Site Configuration",
-						serviceRegistry: serviceRegistry,
-						func: function(name, workspace) {
-							siteService.createSiteConfiguration(name, workspace).then(function(site) {
-								window.location = mSiteUtils.generateEditSiteHref(site);
-							}, errorHandler);
-						}});
-					dialog.startup();
-					dialog.show();
-				}});
-			commandService.addCommand(createCommand, "dom");
-			
-			// Add commands that deal with individual site configuration (edit, start, stop..)
-			mSiteUtils.createSiteCommands(commandService, siteService, statusService, dialogService,
-					/*start*/ refresher, /*stop*/ refresher, /*delete*/ refresher, errorHandler);
-			
-			// Register command contributions
-			commandService.registerCommandContribution("eclipse.sites.create", 1, "pageActions");
-			commandService.registerCommandContribution("eclipse.site.edit", 1);
-			commandService.registerCommandContribution("eclipse.site.start", 2);
-			commandService.registerCommandContribution("eclipse.site.stop", 3);
-			commandService.registerCommandContribution("eclipse.site.delete", 4);
-			
-			mGlobalCommands.generateDomCommandsInBanner(commandService, {});
-		}());
+			(function() {
+				// Reloads the table view after doing a command
+				var refresher = function() {
+					siteService.getSiteConfigurations().then(function(siteConfigs) {
+						statusService.setMessage("");
+						treeWidget.refreshAndExpand("site-table-tree", siteConfigs);
+					});
+				};
+				var errorHandler = dojo.hitch(statusService, statusService.setProgressResult);
+				
+				var createCommand = new mCommands.Command({
+					name : "Create Site",
+					tooltip: "Create a new site configuration",
+					image : require.toUrl("images/add.gif"),
+					id: "eclipse.sites.create",
+					groupId: "eclipse.sitesGroup",
+					callback : function() {
+						var dialog = new orion.widgets.NewSiteDialog({
+							title: "Create Site Configuration",
+							serviceRegistry: serviceRegistry,
+							func: function(name, workspace) {
+								siteService.createSiteConfiguration(name, workspace).then(function(site) {
+									window.location = mSiteUtils.generateEditSiteHref(site);
+								}, errorHandler);
+							}});
+						dialog.startup();
+						dialog.show();
+					}});
+				commandService.addCommand(createCommand, "dom");
+				
+				// Add commands that deal with individual site configuration (edit, start, stop..)
+				mSiteUtils.createSiteCommands(commandService, siteService, statusService, dialogService,
+						/*start*/ refresher, /*stop*/ refresher, /*delete*/ refresher, errorHandler);
+				
+				// Register command contributions
+				commandService.registerCommandContribution("eclipse.sites.create", 1, "pageActions");
+				commandService.registerCommandContribution("eclipse.site.edit", 1);
+				commandService.registerCommandContribution("eclipse.site.start", 2);
+				commandService.registerCommandContribution("eclipse.site.stop", 3);
+				commandService.registerCommandContribution("eclipse.site.delete", 4);
+				
+				mGlobalCommands.generateDomCommandsInBanner(commandService, {});
+			}());
+		});
 	});
 });
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/test/unittest.js b/bundles/org.eclipse.orion.client.core/web/test/unittest.js
index 6d1fc41..65dfaac 100644
--- a/bundles/org.eclipse.orion.client.core/web/test/unittest.js
+++ b/bundles/org.eclipse.orion.client.core/web/test/unittest.js
@@ -11,9 +11,9 @@
  /*global eclipse:true dojo document console*/
 
 
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/pluginregistry', 'orion/preferences', 'orion/commands', 'orion/searchClient', 'orion/globalCommands', 'orion/treetable',
+define(['require', 'dojo', 'orion/serviceregistry', 'orion/pluginregistry', 'orion/bootstrap', 'orion/commands', 'orion/searchClient', 'orion/globalCommands', 'orion/treetable',
         'dojo/hash', 'dojo/parser'],
-        function(require, dojo, mServiceRegistry, mPluginRegistry, mPreferences, mCommands, mSearchClient, mGlobalCommands, mTreetable) {
+        function(require, dojo, mServiceRegistry, mPluginRegistry, mBootstrap, mCommands, mSearchClient, mGlobalCommands, mTreetable) {
 	
 
 var eclipse = eclipse || {};
@@ -128,95 +128,92 @@
 
 var root = {children:[]};
 
-dojo.addOnLoad(function(){
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
-	// create registry and instantiate needed services
-	var serviceRegistry = new mServiceRegistry.ServiceRegistry();
-	var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-	dojo.addOnWindowUnload(function() {
-		pluginRegistry.shutdown();
-	});
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-	var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+dojo.addOnLoad(function() {
+	mBootstrap.startup().then(function(core) {
+		var serviceRegistry = core.serviceRegistry;
+		var preferences = core.preferences;
+		document.body.style.visibility = "visible";
+		dojo.parser.parse();
+		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+		
+		// global banner
+		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
+		
+		function runTests(fileURI) {
+			//console.log("installing non-persistent plugin: " + fileURI);
+			var testOverview = dojo.byId("test-overview");
+			dojo.place(document.createTextNode("Running tests from: "), testOverview, "last");
+			var link = dojo.create("a", {className: "navlink", href: require.toUrl("edit/edit.html") + "#"+fileURI}, testOverview, "last");
+			dojo.place(document.createTextNode(fileURI), link, "last");
+			
+			// these are isolated from the regular service and plugin registry
+			var testServiceRegistry = new mServiceRegistry.ServiceRegistry();
+			var testPluginRegistry = new mPluginRegistry.PluginRegistry(testServiceRegistry, {});
+			
+			
+			testPluginRegistry.installPlugin(fileURI).then(function() {
+				return testServiceRegistry.getService("orion.test.runner");
+			}).then(function(service) {
+				//console.log("got service: " + service);
 	
-	// global banner
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
+				var myTree = new mTreetable.TableTree({
+					model: new eclipse.Unittest.Model(root),
+					showRoot: false,
+					parent: "test-tree",
+					labelColumnIndex: 0,  // 1 if with checkboxes
+					renderer: new eclipse.Unittest.Renderer()
+				});			
 	
-	function runTests(fileURI) {
-		//console.log("installing non-persistent plugin: " + fileURI);
-		var testOverview = dojo.byId("test-overview");
-		dojo.place(document.createTextNode("Running tests from: "), testOverview, "last");
-		var link = dojo.create("a", {className: "navlink", href: require.toUrl("edit/edit.html") + "#"+fileURI}, testOverview, "last");
-		dojo.place(document.createTextNode(fileURI), link, "last");
-		
-		// these are isolated from the regular service and plugin registry
-		var testServiceRegistry = new mServiceRegistry.ServiceRegistry();
-		var testPluginRegistry = new mPluginRegistry.PluginRegistry(testServiceRegistry, {});
-		
-		
-		testPluginRegistry.installPlugin(fileURI).then(function() {
-			return testServiceRegistry.getService("orion.test.runner");
-		}).then(function(service) {
-			//console.log("got service: " + service);
-
-			var myTree = new mTreetable.TableTree({
-				model: new eclipse.Unittest.Model(root),
-				showRoot: false,
-				parent: "test-tree",
-				labelColumnIndex: 0,  // 1 if with checkboxes
-				renderer: new eclipse.Unittest.Renderer()
-			});			
-
-			var times = {};
-			var testCount = 0;
-			var _top;
-			service.addEventListener("runStart", function(name) {
-				var n = name ? name : "<top>";
-				if (!_top) {
-					_top = n;
-				}
-//				console.log("[Test Run] - " + name + " start");
-				times[n] = new Date().getTime();
+				var times = {};
+				var testCount = 0;
+				var _top;
+				service.addEventListener("runStart", function(name) {
+					var n = name ? name : "<top>";
+					if (!_top) {
+						_top = n;
+					}
+	//				console.log("[Test Run] - " + name + " start");
+					times[n] = new Date().getTime();
+				});
+				service.addEventListener("runDone", function(name, obj) {
+					var n = name ? name : "<top>";
+	//				var result = [];
+	//				result.push("[Test Run] - " + name + " done - ");
+	//				result.push("[Failures:" + obj.failures + (name === top ? ", Test Count:" + testCount : "") +"] ");
+	//				result.push("(" + (new Date().getTime() - times[name]) / 1000 + "s)");
+					delete times[n];
+	//				console.log(result.join(""));
+				});
+				service.addEventListener("testStart", function(name) {
+					times[name] = new Date().getTime();
+					testCount++;
+				});
+				service.addEventListener("testDone", function(name, obj) {
+	//				var result = [];
+	//				result.push(obj.result ? " [passed] " : " [failed] ");
+	//				result.push(name);
+					var millis = new Date().getTime() - times[name];
+	//				result.push(" (" + (millis) / 1000 + "s)");
+					delete times[name];
+	//				if (!obj.result) {
+	//					result.push("\n  " + obj.message);
+	//				}
+	//				console.log(result.join(""));
+					root.children.push({"Name":name, result: obj.result, message: obj.message, stack: obj.stack, millis: millis});
+					myTree.refresh(root, root.children);
+				});	
+				service.run().then(function(result) {
+					testPluginRegistry.shutdown();
+				});
 			});
-			service.addEventListener("runDone", function(name, obj) {
-				var n = name ? name : "<top>";
-//				var result = [];
-//				result.push("[Test Run] - " + name + " done - ");
-//				result.push("[Failures:" + obj.failures + (name === top ? ", Test Count:" + testCount : "") +"] ");
-//				result.push("(" + (new Date().getTime() - times[name]) / 1000 + "s)");
-				delete times[n];
-//				console.log(result.join(""));
-			});
-			service.addEventListener("testStart", function(name) {
-				times[name] = new Date().getTime();
-				testCount++;
-			});
-			service.addEventListener("testDone", function(name, obj) {
-//				var result = [];
-//				result.push(obj.result ? " [passed] " : " [failed] ");
-//				result.push(name);
-				var millis = new Date().getTime() - times[name];
-//				result.push(" (" + (millis) / 1000 + "s)");
-				delete times[name];
-//				if (!obj.result) {
-//					result.push("\n  " + obj.message);
-//				}
-//				console.log(result.join(""));
-				root.children.push({"Name":name, result: obj.result, message: obj.message, stack: obj.stack, millis: millis});
-				myTree.refresh(root, root.children);
-			});	
-			service.run().then(function(result) {
-				testPluginRegistry.shutdown();
-			});
+		}
+	
+		dojo.subscribe("/dojo/hashchange", this, function() {
+				runTests(dojo.hash());
 		});
-	}
-
-	dojo.subscribe("/dojo/hashchange", this, function() {
-			runTests(dojo.hash());
+		runTests(dojo.hash());
 	});
-	runTests(dojo.hash());
 });
 
 });
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-clone.js b/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
index 078ffa2..2e581dd 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-clone.js
@@ -7,142 +7,136 @@
  * 
  * Contributors: IBM Corporation - initial API and implementation
  ******************************************************************************/
-var eclipse;
+
 /*global dojo dijit window eclipse serviceRegistry:true widgets alert*/
 /*browser:true*/
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands',
+define(['dojo', 'orion/bootstrap', 'orion/status', 'orion/commands',
         'orion/dialogs', 'orion/selection', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands', 'orion/git/gitClient',
         'orion/ssh/sshTools', 'orion/git/git-clone-details', 'orion/git/git-clones-explorer', 'orion/git/gitCommands',
 	    'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'], 
-		function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mDialogs, mSelection, mFileClient,
+		function(dojo, mBootstrap, mStatus, mCommands, mDialogs, mSelection, mFileClient,
 					mSearchClient, mGlobalCommands, mGitClient, mSshTools, mGitCloneDetails, mGitClonesExplorer, mGitCommands) {
 
-dojo.addOnLoad(function() {
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
-	
-	// initialize service registry and EAS services
-	serviceRegistry = new mServiceregistry.ServiceRegistry();
-	var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-	dojo.addOnUnload(function() {
-		pluginRegistry.shutdown();
-	});
-	new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-	new mDialogs.DialogService(serviceRegistry);
-	var selection = new mSelection.Selection(serviceRegistry);
-	new mSshTools.SshService(serviceRegistry);
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-	
-	// Git operations
-	new mGitClient.GitService(serviceRegistry);
-	
-	var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-
-	// define the command contributions - where things appear, first the groups
-	commandService.addCommandGroup("eclipse.gitGroup", 100, null, null, "pageActions");
-	// git contributions
-	commandService.registerCommandContribution("eclipse.cloneGitRepository", 100, "pageActions", "eclipse.gitGroup");
-	commandService.registerCommandContribution("eclipse.initGitRepository", 101, "pageActions", "eclipse.gitGroup");
-	
-	commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
-	commandService.registerCommandContribution("eclipse.git.deleteClone", 1, "selectionTools", "eclipse.selectionGroup");
-	
-	commandService.addCommandGroup("eclipse.gitGroup2", 1000, "More");
-	commandService.addCommandGroup("eclipse.gitGroup2.u1", 2000, null, "eclipse.gitGroup2");
-	commandService.addCommandGroup("eclipse.gitGroup2.delete", 3000, null, "eclipse.gitGroup2");
-	
-	// clone actions
-	commandService.registerCommandContribution("eclipse.openGitStatus", 100);
-	commandService.registerCommandContribution("eclipse.openGitLogAll", 200);
-	commandService.registerCommandContribution("eclipse.openCloneContent", 300, null, "eclipse.gitGroup2");
-	commandService.registerCommandContribution("eclipse.git.deleteClone", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
-	
-	// remote action
-	commandService.registerCommandContribution("eclipse.addRemote", 100);
-	commandService.registerCommandContribution("eclipse.removeRemote", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
-	
-	// branch actions
-	commandService.registerCommandContribution("eclipse.addBranch", 100);
-	
-	commandService.registerCommandContribution("eclipse.openGitLog", 200);
-	commandService.registerCommandContribution("eclipse.orion.git.fetch", 201);
-	commandService.registerCommandContribution("eclipse.orion.git.merge", 202);
-	
-	commandService.registerCommandContribution("eclipse.checkoutBranch", 301, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
-	commandService.registerCommandContribution("eclipse.orion.git.rebase", 302, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
-	commandService.registerCommandContribution("eclipse.orion.git.push", 303, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
-	commandService.registerCommandContribution("eclipse.orion.git.pushto", 304, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
-	commandService.registerCommandContribution("eclipse.orion.git.resetIndex", 305, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
-	
-	commandService.registerCommandContribution("eclipse.removeBranch", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
-	commandService.registerCommandContribution("eclipse.removeRemoteBranch", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
-	
-	// tag actions
-	commandService.registerCommandContribution("eclipse.checkoutTag", 100);
-	
-	// Clone details
-	var cloneDetails = new mGitCloneDetails.CloneDetails({parent: "cloneDetailsPane", serviceRegistry: serviceRegistry, detailsPane: dijit.byId("orion.innerNavigator")});
-	
-	var explorer = new mGitClonesExplorer.GitClonesExplorer(serviceRegistry, /* selection */ null, cloneDetails, "clonesList", "pageActions"/*, "selectionTools"*/);
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher, explorer);
-	
-	var fileClient = new mFileClient.FileClient(serviceRegistry, function(reference) {
-		var pattern = reference.getProperty("pattern");
-		return pattern && pattern.indexOf("/") === 0;
-	});
-	
-	fileClient.loadWorkspace().then(
-		function(workspace){
-			explorer.setDefaultPath(workspace.Location);
-	
-			// global commands
-			mGitCommands.createFileCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools");
-			mGitCommands.createGitClonesCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools", fileClient);
-	
-			mGitCommands.updateNavTools(serviceRegistry, explorer, "pageActions", "selectionTools", {});
-	
-			explorer.displayClonesList(dojo.hash());
-				
-			//every time the user manually changes the hash, we need to load the workspace with that name
-			dojo.subscribe("/dojo/hashchange", explorer, function() {
-			   explorer.displayClonesList(dojo.hash());
-			});
-
-		}
-	);
+	mBootstrap.startup().then(function(core) {
+		var serviceRegistry = core.serviceRegistry;
+		var preferences = core.preferences;
+		document.body.style.visibility = "visible";
+		dojo.parser.parse();
 		
+		new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+		new mDialogs.DialogService(serviceRegistry);
+		var selection = new mSelection.Selection(serviceRegistry);
+		new mSshTools.SshService(serviceRegistry);
+		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+		
+		// Git operations
+		new mGitClient.GitService(serviceRegistry);
+		
+		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
 	
-	makeRightPane(navigator);
-});
-
-function makeRightPane(explorer){
-	// set up the splitter bar and its key binding
-	var splitArea = dijit.byId("orion.innerNavigator");
+		// define the command contributions - where things appear, first the groups
+		commandService.addCommandGroup("eclipse.gitGroup", 100, null, null, "pageActions");
+		// git contributions
+		commandService.registerCommandContribution("eclipse.cloneGitRepository", 100, "pageActions", "eclipse.gitGroup");
+		commandService.registerCommandContribution("eclipse.initGitRepository", 101, "pageActions", "eclipse.gitGroup");
+		
+		commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
+		commandService.registerCommandContribution("eclipse.git.deleteClone", 1, "selectionTools", "eclipse.selectionGroup");
+		
+		commandService.addCommandGroup("eclipse.gitGroup2", 1000, "More");
+		commandService.addCommandGroup("eclipse.gitGroup2.u1", 2000, null, "eclipse.gitGroup2");
+		commandService.addCommandGroup("eclipse.gitGroup2.delete", 3000, null, "eclipse.gitGroup2");
+		
+		// clone actions
+		commandService.registerCommandContribution("eclipse.openGitStatus", 100);
+		commandService.registerCommandContribution("eclipse.openGitLogAll", 200);
+		commandService.registerCommandContribution("eclipse.openCloneContent", 300, null, "eclipse.gitGroup2");
+		commandService.registerCommandContribution("eclipse.git.deleteClone", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
+		
+		// remote action
+		commandService.registerCommandContribution("eclipse.addRemote", 100);
+		commandService.registerCommandContribution("eclipse.removeRemote", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
+		
+		// branch actions
+		commandService.registerCommandContribution("eclipse.addBranch", 100);
+		
+		commandService.registerCommandContribution("eclipse.openGitLog", 200);
+		commandService.registerCommandContribution("eclipse.orion.git.fetch", 201);
+		commandService.registerCommandContribution("eclipse.orion.git.merge", 202);
+		
+		commandService.registerCommandContribution("eclipse.checkoutBranch", 301, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
+		commandService.registerCommandContribution("eclipse.orion.git.rebase", 302, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
+		commandService.registerCommandContribution("eclipse.orion.git.push", 303, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
+		commandService.registerCommandContribution("eclipse.orion.git.pushto", 304, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
+		commandService.registerCommandContribution("eclipse.orion.git.resetIndex", 305, null, "eclipse.gitGroup2/eclipse.gitGroup2.u1");
+		
+		commandService.registerCommandContribution("eclipse.removeBranch", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
+		commandService.registerCommandContribution("eclipse.removeRemoteBranch", 400, null, "eclipse.gitGroup2/eclipse.gitGroup2.delete");
+		
+		// tag actions
+		commandService.registerCommandContribution("eclipse.checkoutTag", 100);
+		
+		// Clone details
+		var cloneDetails = new mGitCloneDetails.CloneDetails({parent: "cloneDetailsPane", serviceRegistry: serviceRegistry, detailsPane: dijit.byId("orion.innerNavigator")});
+		
+		var explorer = new mGitClonesExplorer.GitClonesExplorer(serviceRegistry, /* selection */ null, cloneDetails, "clonesList", "pageActions"/*, "selectionTools"*/);
+		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, explorer);
+		
+		var fileClient = new mFileClient.FileClient(serviceRegistry, function(reference) {
+			var pattern = reference.getProperty("pattern");
+			return pattern && pattern.indexOf("/") === 0;
+		});
+		
+		fileClient.loadWorkspace().then(
+			function(workspace){
+				explorer.setDefaultPath(workspace.Location);
+		
+				// global commands
+				mGitCommands.createFileCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools");
+				mGitCommands.createGitClonesCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools", fileClient);
+		
+				mGitCommands.updateNavTools(serviceRegistry, explorer, "pageActions", "selectionTools", {});
+		
+				explorer.displayClonesList(dojo.hash());
+					
+				//every time the user manually changes the hash, we need to load the workspace with that name
+				dojo.subscribe("/dojo/hashchange", explorer, function() {
+				   explorer.displayClonesList(dojo.hash());
+				});
 	
-	//by default the pane should be closed
-	if(splitArea.isRightPaneOpen()){
-		splitArea.toggle();
-	}
+			}
+		);
 			
-	var bufferedSelection = [];
-	
-	window.document.onkeydown = function (evt){
-		evt = evt || window.event;
-		var handled = false;
-		if(evt.ctrlKey && evt.keyCode  === 79){ // Ctrl+o handler for toggling outline 
-			splitArea.toggle();
-			handled = true;			
-		} 
-		if (handled) {
-			if (window.document.all) { 
-				evt.keyCode = 0;
-			} else { 
-				evt.preventDefault();
-				evt.stopPropagation();
-			}		
-		}
-	};
-}
+		
+		makeRightPane(navigator);
+	});
 
+	function makeRightPane(explorer){
+		// set up the splitter bar and its key binding
+		var splitArea = dijit.byId("orion.innerNavigator");
+		
+		//by default the pane should be closed
+		if(splitArea.isRightPaneOpen()){
+			splitArea.toggle();
+		}
+				
+		var bufferedSelection = [];
+		
+		window.document.onkeydown = function (evt){
+			evt = evt || window.event;
+			var handled = false;
+			if(evt.ctrlKey && evt.keyCode  === 79){ // Ctrl+o handler for toggling outline 
+				splitArea.toggle();
+				handled = true;			
+			} 
+			if (handled) {
+				if (window.document.all) { 
+					evt.keyCode = 0;
+				} else { 
+					evt.preventDefault();
+					evt.stopPropagation();
+				}		
+			}
+		};
+	}
 });
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-log.js b/bundles/org.eclipse.orion.client.git/web/git/git-log.js
index cbb5316..67bd2ae 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-log.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-log.js
@@ -10,85 +10,85 @@
 
 /*global window define document dijit */
 /*browser:true*/
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands',
+define(['require', 'dojo', 'orion/bootstrap', 'orion/status', 'orion/commands',
         'orion/auth', 'orion/dialogs', 'orion/selection', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands', 'orion/git/gitClient',
         'orion/breadcrumbs', 'orion/ssh/sshTools', 'orion/git/git-commit-details', 'orion/git/git-commit-navigator', 'orion/git/gitCommands',
 	    'orion/links', 'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'], 
-		function(require, dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mAuth, mDialogs, mSelection, mFileClient,
+		function(require, dojo, mBootstrap, mStatus, mCommands, mAuth, mDialogs, mSelection, mFileClient,
 					mSearchClient, mGlobalCommands, mGitClient, mBreadcrumbs, mSshTools, mGitCommitDetails, mGitCommitNavigator, mGitCommands, mLinks) {
 
+// TODO: This is naughty -- feel bad and then fix it please
 var serviceRegistry;
-dojo.addOnLoad(function() {
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
 	
-	// initialize service registry and EAS services
-	serviceRegistry = new mServiceregistry.ServiceRegistry();
-	var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-	dojo.addOnUnload(function() {
-		pluginRegistry.shutdown();
+	dojo.addOnLoad(function() {
+		mBootstrap.startup().then(function(core) {
+			serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
+			
+		
+			new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+			new mDialogs.DialogService(serviceRegistry);
+			var selection = new mSelection.Selection(serviceRegistry);
+			new mSshTools.SshService(serviceRegistry);
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry, selection: selection});
+			var linkService = new mLinks.TextLinkService({serviceRegistry: serviceRegistry});
+			
+			var branch;
+		
+			// Git operations
+			var gitClient = new mGitClient.GitService(serviceRegistry);
+			
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			
+			// Commit details
+			var commitDetails = new mGitCommitDetails.CommitDetails({parent: "commitDetailsPane", commandService: commandService, linkService: linkService, detailsPane: dijit.byId("orion.innerNavigator")});
+			// Commit navigator
+			var navigator = new mGitCommitNavigator.GitCommitNavigator(serviceRegistry, selection, commitDetails, null, "explorer-tree", "pageTitle", "pageActions", "selectionTools");
+			
+			// global commands
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, navigator);
+			
+			//TODO this should be removed and contributed by a plug-in
+			mGitCommands.createFileCommands(serviceRegistry, commandService, navigator, "pageActions", "selectionTools");
+			
+			// define the command contributions - where things appear, first the groups
+			commandService.addCommandGroup("eclipse.gitGroup.nav", 200, "More");
+			commandService.addCommandGroup("eclipse.gitGroup.page", 100, null, null, "pageActions");
+			commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
+			
+			// commands appearing directly in local actions column
+			commandService.registerCommandContribution("eclipse.openGitCommit", 1);
+			commandService.registerCommandContribution("eclipse.compareWithWorkingTree", 2);
+		
+			// selection based command contributions in nav toolbar
+			commandService.registerCommandContribution("eclipse.compareGitCommits", 1, "selectionTools", "eclipse.selectionGroup");
+			
+			// git contributions
+			commandService.registerCommandContribution("eclipse.orion.git.fetch", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.fetchForce", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.merge", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.switchToCurrentLocal", 100, "pageActions", "eclipse.gitGroup.page");	
+			commandService.registerCommandContribution("eclipse.orion.git.push", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.pushForce", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.switchToRemote", 100, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.previousLogPage", 200, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.nextLogPage", 201, "pageActions", "eclipse.gitGroup.page");
+			commandService.registerCommandContribution("eclipse.orion.git.addTag", 3);
+			commandService.registerCommandContribution("eclipse.orion.git.cherryPick", 3);
+			
+			loadResource(navigator);
+			
+			makeRightPane(navigator);
+		
+			// every time the user manually changes the hash, we need to load the
+			// workspace with that name
+			dojo.subscribe("/dojo/hashchange", navigator, function() {
+				loadResource(navigator);
+			});
+		});
 	});
-	new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-	new mDialogs.DialogService(serviceRegistry);
-	var selection = new mSelection.Selection(serviceRegistry);
-	new mSshTools.SshService(serviceRegistry);
-	var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-	var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry, selection: selection});
-	var linkService = new mLinks.TextLinkService({serviceRegistry: serviceRegistry});
-	
-	var branch;
-
-	// Git operations
-	var gitClient = new mGitClient.GitService(serviceRegistry);
-	
-	var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-	
-	// Commit details
-	var commitDetails = new mGitCommitDetails.CommitDetails({parent: "commitDetailsPane", commandService: commandService, linkService: linkService, detailsPane: dijit.byId("orion.innerNavigator")});
-	// Commit navigator
-	var navigator = new mGitCommitNavigator.GitCommitNavigator(serviceRegistry, selection, commitDetails, null, "explorer-tree", "pageTitle", "pageActions", "selectionTools");
-	
-	// global commands
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher, navigator);
-	
-	//TODO this should be removed and contributed by a plug-in
-	mGitCommands.createFileCommands(serviceRegistry, commandService, navigator, "pageActions", "selectionTools");
-	
-	// define the command contributions - where things appear, first the groups
-	commandService.addCommandGroup("eclipse.gitGroup.nav", 200, "More");
-	commandService.addCommandGroup("eclipse.gitGroup.page", 100, null, null, "pageActions");
-	commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
-	
-	// commands appearing directly in local actions column
-	commandService.registerCommandContribution("eclipse.openGitCommit", 1);
-	commandService.registerCommandContribution("eclipse.compareWithWorkingTree", 2);
-
-	// selection based command contributions in nav toolbar
-	commandService.registerCommandContribution("eclipse.compareGitCommits", 1, "selectionTools", "eclipse.selectionGroup");
-	
-	// git contributions
-	commandService.registerCommandContribution("eclipse.orion.git.fetch", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.fetchForce", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.merge", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.switchToCurrentLocal", 100, "pageActions", "eclipse.gitGroup.page");	
-	commandService.registerCommandContribution("eclipse.orion.git.push", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.pushForce", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.switchToRemote", 100, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.previousLogPage", 200, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.nextLogPage", 201, "pageActions", "eclipse.gitGroup.page");
-	commandService.registerCommandContribution("eclipse.orion.git.addTag", 3);
-	commandService.registerCommandContribution("eclipse.orion.git.cherryPick", 3);
-	
-	loadResource(navigator);
-	
-	makeRightPane(navigator);
-
-	// every time the user manually changes the hash, we need to load the
-	// workspace with that name
-	dojo.subscribe("/dojo/hashchange", navigator, function() {
-		loadResource(navigator);
-	});
-});
 
 function loadResource(navigator){
 	var path = dojo.hash();
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-status.js b/bundles/org.eclipse.orion.client.git/web/git/git-status.js
index 210433e..c63675a 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-status.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-status.js
@@ -8,41 +8,40 @@
  * Contributors: IBM Corporation - initial API and implementation
  ******************************************************************************/
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status',  'orion/commands',
+define(['dojo', 'orion/bootstrap', 'orion/status',  'orion/commands',
 	        'orion/searchClient', 'orion/globalCommands', 'orion/git/gitClient', 'orion/git/git-status-table', 'orion/breadcrumbs','orion/dialogs','orion/ssh/sshTools',
 	        'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane'], 
-			function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mSearchClient, mGlobalCommands, mGitClient, mGitStatusTable, mBreadcrumbs,mDialogs,mSshTools) {
+			function(dojo, mBootstrap, mStatus, mCommands, mSearchClient, mGlobalCommands, mGitClient, mGitStatusTable, mBreadcrumbs,mDialogs,mSshTools) {
 
 	dojo.addOnLoad(function() {
-		document.body.style.visibility = "visible";
-		dojo.parser.parse();
-		// initialize service registry and EAS services
-		var serviceRegistry = new mServiceregistry.ServiceRegistry();
-		var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-		var preferenceService = new mPreferences.PreferencesService(serviceRegistry);
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		// Git operations
-		new mGitClient.GitService(serviceRegistry);
-		new mSshTools.SshService(serviceRegistry);
-		// File operations
-	
-		new mDialogs.DialogService(serviceRegistry);
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			// Git operations
+			new mGitClient.GitService(serviceRegistry);
+			new mSshTools.SshService(serviceRegistry);
+			// File operations
 		
-		var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-	
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferenceService, searcher);
-	
-		var controller = new mGitStatusTable.GitStatusController({renderLog :true},serviceRegistry , commandService , statusService,"unstagedZone" , "stagedZone");
-		controller.getGitStatus(dojo.hash(),true);
-	
-		//every time the user manually changes the hash, we need to load the git status
-		dojo.subscribe("/dojo/hashchange", controller, function() {
+			new mDialogs.DialogService(serviceRegistry);
+			
+			var statusService = new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+		
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher);
+		
+			var controller = new mGitStatusTable.GitStatusController({renderLog :true},serviceRegistry , commandService , statusService,"unstagedZone" , "stagedZone");
 			controller.getGitStatus(dojo.hash(),true);
-		});
 		
+			//every time the user manually changes the hash, we need to load the git status
+			dojo.subscribe("/dojo/hashchange", controller, function() {
+				controller.getGitStatus(dojo.hash(),true);
+			});
+			
+		});
 	});
-
 });
 
 
diff --git a/bundles/org.eclipse.orion.client.users.ui/web/profile/user-list.js b/bundles/org.eclipse.orion.client.users.ui/web/profile/user-list.js
index fb4d420..490e66f 100644
--- a/bundles/org.eclipse.orion.client.users.ui/web/profile/user-list.js
+++ b/bundles/org.eclipse.orion.client.users.ui/web/profile/user-list.js
@@ -8,131 +8,128 @@
  * Contributors: IBM Corporation - initial API and implementation
  ******************************************************************************/
 
-define(['require', 'dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/status', 'orion/commands', 'orion/selection',
+define(['require', 'dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 'orion/selection',
 	        'orion/searchClient', 'orion/globalCommands', 'orion/profile/UsersList', 'orion/profile/usersUtil',
 	        'dojo/parser', 'dojo/hash', 'dojo/date/locale', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/profile/widgets/NewUserDialog',
 	        'orion/profile/widgets/ResetPasswordDialog'], 
-			function(require, dojo, mServiceregistry, mPreferences, mPluginRegistry, mStatus, mCommands, mSelection, mSearchClient, mGlobalCommands, mUsersList, mUsersUtil) {
+			function(require, dojo, mBootstrap, mStatus, mCommands, mSelection, mSearchClient, mGlobalCommands, mUsersList, mUsersUtil) {
 
-dojo.addOnLoad(function() {
-	document.body.style.visibility = "visible";
-	dojo.parser.parse();
-
-	var serviceRegistry = new mServiceregistry.ServiceRegistry();
-	var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-	dojo.addOnUnload(function() {
-		pluginRegistry.shutdown();
-	});
-	var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-	var prefsService = new mPreferences.PreferencesService(serviceRegistry);
-	var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-	var selection = new mSelection.Selection(serviceRegistry);
-
-	mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, prefsService, searcher, usersList, usersList);
-	mGlobalCommands.generateDomCommandsInBanner(commandService, usersList);
-
-	var usersList = new mUsersList.UsersList(serviceRegistry, selection, searcher, "usersList", "pageActions", "selectionTools");
-	
-	var createUserCommand = new mCommands.Command({
-		name: "Create User",
-		id: "eclipse.createUser",
-		callback: function() {
-			var dialog = new orion.profile.widgets.NewUserDialog({
-				func : dojo.hitch(usersList, function() {
-					this.reloadUsers();
-				}),
-				registry : serviceRegistry
-			});
-			dialog.startup();
-			dialog.show();
-		},
-		visibleWhen: function(item) {
-			return true;
-		}
-	});
-	
-	commandService.addCommand(createUserCommand, "dom");
+	dojo.addOnLoad(function() {
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
 		
-	var deleteCommand = new mCommands.Command({
-		name: "Delete User",
-		image: require.toUrl("images/delete.gif"),
-		id: "eclipse.deleteUser",
-		visibleWhen: function(item) {
-			var items = dojo.isArray(item) ? item : [item];
-			if (items.length === 0) {
-				return false;
-			}
-			for (var i=0; i < items.length; i++) {
-				if (!items[i].Location) {
-					return false;
-				}
-			}
-			return true;
-		},
-		callback: function(item) {
-			if(dojo.isArray(item) && item.length > 1){
-				if(confirm("Are you sure you want to delete these " + item.length + " users?")){
-					serviceRegistry.getService("orion.core.user").then(function(service) {
-						var usersProcessed = 0;
-						for(var i=0; i<item.length; i++){
-							  service.deleteUser(item[i].Location).then( dojo.hitch(usersList, function(jsonData) {
-								  usersProcessed++;
-								  if(usersProcessed==item.length)
-									  this.reloadUsers();
-							  }));	
-						}
-					});
-				}
-				
-			}else{
-				item = dojo.isArray(item) ? item[0] : item;
-				if (confirm("Are you sure you want to delete user '" + item.login + "'?")) {
-					serviceRegistry.getService("orion.core.user").then(function(service) {
-					  service.deleteUser(item.Location).then( dojo.hitch(usersList, function(jsonData) {
-						  this.reloadUsers();
-					  }));
-					});
-				}
-			}
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			var selection = new mSelection.Selection(serviceRegistry);
+		
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, usersList, usersList);
+			mGlobalCommands.generateDomCommandsInBanner(commandService, usersList);
+		
+			var usersList = new mUsersList.UsersList(serviceRegistry, selection, searcher, "usersList", "pageActions", "selectionTools");
 			
-		}
-	});
-	commandService.addCommand(deleteCommand, "object");
-	commandService.addCommand(deleteCommand, "dom");
-	
-	var changePasswordCommand = new mCommands.Command({
-		name: "Change Password",
-		id: "eclipse.changePassword",
-		callback: function(item) {
-			var dialog = new orion.profile.widgets.ResetPasswordDialog({
-				user: item,
-				registry : serviceRegistry
+			var createUserCommand = new mCommands.Command({
+				name: "Create User",
+				id: "eclipse.createUser",
+				callback: function() {
+					var dialog = new orion.profile.widgets.NewUserDialog({
+						func : dojo.hitch(usersList, function() {
+							this.reloadUsers();
+						}),
+						registry : serviceRegistry
+					});
+					dialog.startup();
+					dialog.show();
+				},
+				visibleWhen: function(item) {
+					return true;
+				}
 			});
-			dialog.startup();
-			dialog.show();
 			
-		},
-		visibleWhen: function(item){
-			return true;
-		}
+			commandService.addCommand(createUserCommand, "dom");
+				
+			var deleteCommand = new mCommands.Command({
+				name: "Delete User",
+				image: require.toUrl("images/delete.gif"),
+				id: "eclipse.deleteUser",
+				visibleWhen: function(item) {
+					var items = dojo.isArray(item) ? item : [item];
+					if (items.length === 0) {
+						return false;
+					}
+					for (var i=0; i < items.length; i++) {
+						if (!items[i].Location) {
+							return false;
+						}
+					}
+					return true;
+				},
+				callback: function(item) {
+					if(dojo.isArray(item) && item.length > 1){
+						if(confirm("Are you sure you want to delete these " + item.length + " users?")){
+							serviceRegistry.getService("orion.core.user").then(function(service) {
+								var usersProcessed = 0;
+								for(var i=0; i<item.length; i++){
+									  service.deleteUser(item[i].Location).then( dojo.hitch(usersList, function(jsonData) {
+										  usersProcessed++;
+										  if(usersProcessed==item.length)
+											  this.reloadUsers();
+									  }));	
+								}
+							});
+						}
+						
+					}else{
+						item = dojo.isArray(item) ? item[0] : item;
+						if (confirm("Are you sure you want to delete user '" + item.login + "'?")) {
+							serviceRegistry.getService("orion.core.user").then(function(service) {
+							  service.deleteUser(item.Location).then( dojo.hitch(usersList, function(jsonData) {
+								  this.reloadUsers();
+							  }));
+							});
+						}
+					}
+					
+				}
+			});
+			commandService.addCommand(deleteCommand, "object");
+			commandService.addCommand(deleteCommand, "dom");
+			
+			var changePasswordCommand = new mCommands.Command({
+				name: "Change Password",
+				id: "eclipse.changePassword",
+				callback: function(item) {
+					var dialog = new orion.profile.widgets.ResetPasswordDialog({
+						user: item,
+						registry : serviceRegistry
+					});
+					dialog.startup();
+					dialog.show();
+					
+				},
+				visibleWhen: function(item){
+					return true;
+				}
+			});
+			commandService.addCommand(changePasswordCommand, "object");
+			
+			
+		
+			// define the command contributions - where things appear, first the groups
+			commandService.addCommandGroup("eclipse.usersGroup", 100, null, null, "pageActions");
+			commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
+			
+			commandService.registerCommandContribution("eclipse.createUser", 1, "pageActions", "eclipse.usersGroup");
+			
+			commandService.registerCommandContribution("eclipse.deleteUser", 1);
+			commandService.registerCommandContribution("eclipse.changePassword", 2);
+			commandService.registerCommandContribution("eclipse.deleteUser", 1, "selectionTools", "eclipse.selectionGroup");
+			
+		
+			usersList.loadUsers();
+			mUsersUtil.updateNavTools(serviceRegistry, usersList, "pageActions", "selectionTools", {});	
+		});
 	});
-	commandService.addCommand(changePasswordCommand, "object");
-	
-	
-
-	// define the command contributions - where things appear, first the groups
-	commandService.addCommandGroup("eclipse.usersGroup", 100, null, null, "pageActions");
-	commandService.addCommandGroup("eclipse.selectionGroup", 500, "More actions", null, "selectionTools");
-	
-	commandService.registerCommandContribution("eclipse.createUser", 1, "pageActions", "eclipse.usersGroup");
-	
-	commandService.registerCommandContribution("eclipse.deleteUser", 1);
-	commandService.registerCommandContribution("eclipse.changePassword", 2);
-	commandService.registerCommandContribution("eclipse.deleteUser", 1, "selectionTools", "eclipse.selectionGroup");
-	
-
-	usersList.loadUsers();
-	mUsersUtil.updateNavTools(serviceRegistry, usersList, "pageActions", "selectionTools", {});	
-});
-
 });
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.users.ui/web/profile/user-profile.js b/bundles/org.eclipse.orion.client.users.ui/web/profile/user-profile.js
index 744aa7f..8232a7c 100644
--- a/bundles/org.eclipse.orion.client.users.ui/web/profile/user-profile.js
+++ b/bundles/org.eclipse.orion.client.users.ui/web/profile/user-profile.js
@@ -9,37 +9,35 @@
  ******************************************************************************/
 /*global dojo dijit window eclipse:true*/
 
-define(['dojo', 'orion/serviceregistry', 'orion/preferences', 'orion/pluginregistry', 'orion/commands', 'orion/profile/usersClient', 'orion/profile/profile',
+define(['dojo', 'orion/bootstrap', 'orion/commands', 'orion/profile/usersClient', 'orion/profile/profile',
 	        'orion/searchClient', 'orion/globalCommands', 'orion/status',
 	        'dojo/parser', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane'], 
-			function(dojo, mServiceregistry, mPreferences, mPluginRegistry, mCommands, mUsersClient, mProfile, mSearchClient, mGlobalCommands, mStatus) {
+			function(dojo, mBootstrap, mCommands, mUsersClient, mProfile, mSearchClient, mGlobalCommands, mStatus) {
 
 	dojo.addOnLoad(function() {
-		document.body.style.visibility = "visible";
-		dojo.parser.parse();
+		mBootstrap.startup().then(function(core) {
+			var serviceRegistry = core.serviceRegistry;
+			var preferences = core.preferences;
+			var pluginRegistry = core.pluginRegistry;
+			document.body.style.visibility = "visible";
+			dojo.parser.parse();
 	
-		var serviceRegistry = new mServiceregistry.ServiceRegistry();
-		var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry);
-		dojo.addOnUnload(function() {
-			pluginRegistry.shutdown();
+			var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+			var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
+			var usersClient = new mUsersClient.UsersClient(serviceRegistry, pluginRegistry);
+			new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
+			
+			var profile = new mProfile.Profile({
+				registry: serviceRegistry,
+				pluginRegistry: pluginRegistry,
+				profilePlaceholder: dojo.byId('profileContent'),
+				commandService: commandService,
+				pageActionsPlaceholder: dojo.byId('pageActions'),
+				usersClient: usersClient
+			});
+			
+			mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, preferences, searcher, profile);
+			mGlobalCommands.generateDomCommandsInBanner(commandService, profile);
 		});
-		var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
-		var prefsService = new mPreferences.PreferencesService(serviceRegistry);
-		var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService});
-		var usersClient = new mUsersClient.UsersClient(serviceRegistry, pluginRegistry);
-		new mStatus.StatusReportingService(serviceRegistry, "statusPane", "notifications");
-		
-		var profile = new mProfile.Profile({
-			registry: serviceRegistry,
-			pluginRegistry: pluginRegistry,
-			profilePlaceholder: dojo.byId('profileContent'),
-			commandService: commandService,
-			pageActionsPlaceholder: dojo.byId('pageActions'),
-			usersClient: usersClient
-		});
-		
-		mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, prefsService, searcher, profile);
-		mGlobalCommands.generateDomCommandsInBanner(commandService, profile);
 	});
-
 });