Index: Dev/branches/rest-dojo-ui/build/build.sh
===================================================================
--- Dev/branches/rest-dojo-ui/build/build.sh	(revision 407)
+++ Dev/branches/rest-dojo-ui/build/build.sh	(revision 408)
@@ -1,3 +1,9 @@
 #!/bin/bash
+
+PROFILE=$1
+if [ -z "$PROFILE" ]; then
+    echo "Usage: $0 <profile.js>"
+    exit 1
+fi
 
 TIME0=$SECONDS
@@ -11,5 +17,5 @@
 
 echo "Start Dojo build process."
-"$SRCDIR/util/buildscripts/build.sh" --profile rft.profile.js
+"$SRCDIR/util/buildscripts/build.sh" --profile "$PROFILE"
 
 echo "Copying application top level resources."
Index: Dev/branches/rest-dojo-ui/build/debug.profile.js
===================================================================
--- Dev/branches/rest-dojo-ui/build/debug.profile.js	(revision 408)
+++ Dev/branches/rest-dojo-ui/build/debug.profile.js	(revision 408)
@@ -0,0 +1,45 @@
+var profile = (function(){
+
+    return {
+        basePath: '../client/',
+        action: 'release',
+
+        mini: false,
+        layerOptimize: false,
+        optimize: false,
+        cssOptimize: false,
+        stripConsole: false,
+
+        selectorEngine: 'acme',
+
+        defaultConfig: {
+            async: true,
+            parseOnLoad: false
+        },
+
+        packages: [
+            'dojo',
+            'dijit',
+            'dojox',
+            'rft',
+            'config'
+        ],
+
+        layers: {
+            'dojo/dojo': {
+                include: [ 'dojo/dojo', 'dojo/domReady', 'dojo/_base/declare' ],
+                boot: true,
+                customBase: true
+            },
+            'rft/run' :{
+                include: [ 'rft/run' ]
+            },
+            'config/db' :{
+                include: [ 'config/db' ]
+            }/*,
+            'rft/view' :{
+                include: [ 'rft/view' ]
+            }*/
+        }
+    };
+})();
Index: Dev/branches/rest-dojo-ui/build/release.profile.js
===================================================================
--- Dev/branches/rest-dojo-ui/build/release.profile.js	(revision 408)
+++ Dev/branches/rest-dojo-ui/build/release.profile.js	(revision 408)
@@ -0,0 +1,60 @@
+var profile = (function(){
+
+    return {
+        basePath: '../client/',
+        action: 'release',
+
+        mini: true,
+        layerOptimize: 'closure',
+        optimize: 'closure',
+        cssOptimize: 'comments',
+        stripConsole: 'warn',
+
+        selectorEngine: 'acme',
+
+        defaultConfig: {
+            async: true,
+            parseOnLoad: false
+        },
+
+        staticHasFeatures: {
+            "dojo-loader": 1,
+            "dojo-config-api": 1,
+            "dojo-dom-ready-api": 1,
+            "dojo-has-api": 1,
+            "dojo-inject-api": 1,
+
+            "dojo-trace-api": 0,
+            "dojo-log-api": 0,
+            "dojo-publish-privates": 0,
+
+            "dom": 1,
+            "host-browser": 1
+        },
+
+        packages: [
+            'dojo',
+            'dijit',
+            'dojox',
+            'rft',
+            'config'
+        ],
+
+        layers: {
+            'dojo/dojo': {
+                include: [ 'dojo/dojo', 'dojo/domReady', 'dojo/_base/declare' ],
+                boot: true,
+                customBase: true
+            },
+            'rft/run' :{
+                include: [ 'rft/run' ]
+            },
+            'config/db' :{
+                include: [ 'config/db' ]
+            }/*,
+            'rft/view' :{
+                include: [ 'rft/view' ]
+            }*/
+        }
+    };
+})();
Index: Dev/branches/rest-dojo-ui/build/rft.profile.js
===================================================================
--- Dev/branches/rest-dojo-ui/build/rft.profile.js	(revision 407)
+++ 	(revision )
@@ -1,56 +1,0 @@
-var profile = (function(){
-
-    return {
-        basePath: '../client/',
-        action: 'release',
-
-        mini: true,
-        layerOptimize: 'closure',
-        optimize: 'closure',
-        cssOptimize: 'comments',
-        stripConsole: 'warn',
-
-        selectorEngine: 'acme',
-
-        defaultConfig: {
-            async: true,
-            parseOnLoad: false
-        },
-
-        staticHasFeatures: {
-            "dojo-loader": 1,
-            "dojo-config-api": 1,
-            "dojo-dom-ready-api": 1,
-            "dojo-has-api": 1,
-            "dojo-inject-api": 1,
-
-            "dojo-trace-api": 0,
-            "dojo-log-api": 0,
-            "dojo-publish-privates": 0,
-
-            "dom": 1,
-            "host-browser": 1
-        },
-
-        packages: [
-            'dojo',
-            'dijit',
-            'dojox',
-            'rft'
-        ],
-
-        layers: {
-            'dojo/dojo': {
-                include: [ 'dojo/dojo', 'dojo/domReady', 'dojo/_base/declare' ],
-                boot: true,
-                customBase: true
-            },
-            'rft/run' :{
-                include: [ 'rft/run' ]
-            }/*,
-            'rft/view' :{
-                include: [ 'rft/view' ]
-            }*/
-        }
-    };
-})();
Index: Dev/branches/rest-dojo-ui/client/config/db.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/config/db.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/config/db.js	(revision 408)
@@ -6,11 +6,6 @@
          'dojo/query',
          'dijit/registry',
-         'dojo/text!./docs.json',
-         'dojo/domReady!',
-         'dijit/form/TextBox',
-         'dijit/form/Button',
-         'dijit/form/CheckBox',
-         ],
-    function(json,lang,xhr,parser,query,registry,docsJson){
+         'dojo/domReady!'
+],function(json,lang,xhr,parser,query,registry){
     var logNode;
     var usernameInput, passwordInput, resetInput, configButton;
@@ -18,18 +13,19 @@
     var dbUrl = "../data/";
 
-    parser.parse();
+    parser.parse()
+    .then(function(){
+        query("#log").forEach(function(n){logNode = n;});
+        usernameInput = registry.byId('username');
+        passwordInput = registry.byId('password');
+        resetInput = registry.byId('reset');
+        configButton = registry.byId('configure');
 
-    query("#log").forEach(function(n){logNode = n;});
-    usernameInput = registry.byId('username');
-    passwordInput = registry.byId('password');
-    resetInput = registry.byId('reset');
-    configButton = registry.byId('configure');
+        usernameInput.set('value',defaultUsername);
+        passwordInput.set('value',defaultPassword);
+        configButton.on('click',configure);
 
-    usernameInput.set('value',defaultUsername);
-    passwordInput.set('value',defaultPassword);
-    configButton.on('click',configure);
+        log("Give CouchDB admin username & password and click 'Configure' to start.\nIf the database already exists, rft_admin password will suffice.",true);
+    });
 
-    log("Give CouchDB admin username & password and click 'Configure' to start.\nIf the database already exists, rft_admin password will suffice.",true);
-    
     function configure(){
         var docs;
Index: Dev/branches/rest-dojo-ui/client/config/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/config/index.html	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/config/index.html	(revision 408)
@@ -2,9 +2,7 @@
 <html>
     <head>
+        <title>Research Facilitator Tool - CouchDB Configure</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-        <title>Research Facilitator Tool - CouchDB Configure</title>
-        <script type="text/javascript" src="../dojotoolkit/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: false, isDebug: true"></script>
-        <script type="text/javascript" src="db.js"></script>
-        <link rel="stylesheet" type="text/css" href="../dojotoolkit/dijit/themes/claro/claro.css" />
+        <link rel="stylesheet" type="text/css" href="../dijit/themes/claro/claro.css" />
         <style>
             label {
@@ -15,10 +13,12 @@
     </head>
     <body class="claro">
+        <script type="text/javascript" src="../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: false, isDebug: true"></script>
+        <script type="text/javascript" src="db.js"></script>
         <h1>Configure CouchDB</h1>
         <div>
-            <label for="username">Admin username</label><input type="text" id="username" data-dojo-type="dijit.form.TextBox"/><br/>
-            <label for="password">Admin password</label><input type="password" id="password" data-dojo-type="dijit.form.TextBox"/><br/>
-            <label for="reset">Full reset</label><input type="checkbox" id="reset" data-dojo-type="dijit.form.CheckBox"/><br/>
-            <button id="configure" data-dojo-type="dijit.form.Button">Configure</button><br/>
+            <label for="username">Admin username</label><input type="text" id="username" data-dojo-type="dijit/form/TextBox"/><br/>
+            <label for="password">Admin password</label><input type="password" id="password" data-dojo-type="dijit/form/TextBox"/><br/>
+            <label for="reset">Full reset</label><input type="checkbox" id="reset" data-dojo-type="dijit/form/CheckBox"/><br/>
+            <button id="configure" data-dojo-type="dijit/form/Button">Configure</button><br/>
         </div>
         <pre id="log">Waiting for configurator to initialize...</pre>
Index: Dev/branches/rest-dojo-ui/client/config/package.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/config/package.js	(revision 408)
+++ Dev/branches/rest-dojo-ui/client/config/package.js	(revision 408)
@@ -0,0 +1,12 @@
+var profile = (function(){
+    return {
+        resourceTags: {
+            amd: function (filename, mid) {
+                return /\.js$/.test(filename);
+            },
+            declarative: function(filename,mid) {
+                return /\.html$/.test(filename);
+            }
+        }
+    };
+})();
Index: Dev/branches/rest-dojo-ui/client/config/package.json
===================================================================
--- Dev/branches/rest-dojo-ui/client/config/package.json	(revision 408)
+++ Dev/branches/rest-dojo-ui/client/config/package.json	(revision 408)
@@ -0,0 +1,9 @@
+{
+    "name": "config",
+    "description": "RFT CouchDB Configuration Tool",
+    "dependencies": {
+        "dojo": "~1.8.0",
+        "dijit": "~1.8.0"
+    },
+    "dojoBuild": "package.js"
+}
Index: Dev/branches/rest-dojo-ui/client/rft/ui/LoginDialog.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/LoginDialog.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/LoginDialog.js	(revision 408)
@@ -1,5 +1,5 @@
 define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/event','dijit/Dialog',
     'dijit/_WidgetsInTemplateMixin','../auth', 'dojo/text!./templates/LoginDialog.html',
-    '../content','dijit/form/Form','dijit/form/Button','dijit/form/TextBox'],
+    '../app/Controller','dijit/form/Form','dijit/form/Button','dijit/form/TextBox'],
     function (declare, lang, event, Dialog, _WidgetsInTemplateMixin, auth, template, content) {
         return declare([Dialog,_WidgetsInTemplateMixin], {
