Index: Dev/branches/rest-dojo-ui/client/rft/app/Controller.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/app/Controller.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/app/Controller.js	(revision 407)
@@ -0,0 +1,145 @@
+define([
+    'dojo/_base/declare',
+    'dojo/hash',
+    'dojo/io-query',
+    'dojo/topic',
+    './Page',
+    'dijit/registry'
+],function(declare,hash,ioQuery,topic,Page,registry){
+
+
+    var Controller = declare(null,{
+        _started: false,
+        _routes: null,
+        _container: null,
+        _previousHash: null,
+        _previousContent: null,
+
+        _paramMatch: /:(\w[\w\d]*)/g,
+        _paramReplace: "([^\\/]+)",
+
+        constructor: function() {
+            this._routes = [];
+        },
+        startup: function() {
+            if ( this._started ) { return; }
+
+            var self = this;
+
+            this._container = registry.byId('content');
+            if ( !this._container || !this._container.addChild ) {
+                throw new Error("Cannot find container widget with id 'content'.");
+            }
+            this._started = true;
+
+            if ( hash() === "" ) {
+                hash("#!/");
+            }
+            this._handlePathChange(hash());
+			topic.subscribe("/dojo/hashchange", function(){
+                self._handlePathChange.apply(self,arguments);
+            });
+        },
+        register: function(route) {
+            var self = this;
+            var callback;
+            if ( route.callback ) {
+                callback = function(params){
+                    self._setContent(route.callback(params));
+                };
+            } else if ( route.redirect ) {
+                callback = function(params){
+                    self.go(route.redirect);
+                };
+            } else if ( route.constructor ) {
+                callback = function(params){
+                    self._setContent( new route.constructor(params) );
+                };
+            }
+            if ( callback ) {
+                if ( route.path ) {
+                    this._routes.push(this._createRoute(route.path,callback));
+                } else {
+                    this._defaultCallback = callback;
+                }
+            } else {
+                console.warn("Route "+(route.path||"default")+" has no action.");
+            }
+        },
+        _createRoute: function(path,callback) {
+            var match, route = {};
+            route.callback = callback;
+            route.paramNames = [];
+			while((match = this._paramMatch.exec(path)) !== null){
+				route.paramNames.push(match[1]);
+			}
+            path = path.replace(this._paramMatch, this._paramReplace);
+            route.regexp = new RegExp('^!'+path+'(!.*)?$');
+            return route;
+        },
+        _handlePathChange: function(newHash) {
+            if ( this._previousHash === newHash ) { return; }
+            this._previousHash = newHash;
+
+            for (var i = this._routes.length-1; i >= 0; i--) {
+                var result;
+                var route = this._routes[i];
+
+                if ((result = route.regexp.exec(newHash)) !== null) {
+                    var numParams = route.paramNames.length;
+
+                    var params = {};
+                    for (var j = 0; j < numParams; j++) {
+                        params[route.paramNames[j]] = result[j+1];
+                    }
+
+                    if ( result.length > numParams+1 ) {
+                        params.options = ioQuery.queryToObject(result[numParams]);
+                    }
+
+                    try {
+                        route.callback(params);
+                    } catch(err) {
+                        console.warn("Page change failed.",err);
+                    }
+                    return;
+                }
+            }
+
+            try {
+                this._defaultCallback();
+            } catch(err) {
+                console.warn("Default page failed.",err);
+            }
+        },
+        go: function(path,args) {
+            if ( !this._started ) { return; }
+            var newHash = this._pathToHash(path,args);
+            this._handlePathChange(newHash);
+            hash(newHash);
+        },
+        _pathToHash: function(path,args) {
+            var hash = '!'+path;
+            if ( args ) {
+                hash += '!'+ioQuery.objectToQuery(args);
+            }
+            return hash;
+        },
+        _setContent: function(widget) {
+            if ( this._previousContent ) {
+                this._previousContent.destroyRecursive();
+                this._previousContent = null;
+            }
+            widget.region = 'center';
+            this._container.addChild(widget);
+            this._previousContent = widget;
+        },
+        _defaultCallback: function() {
+            this._setContent(new Page({
+                templateString: "<div>Requested page not found. Go <a href=\"#!/\">home</a>.</div>"
+            }));
+        }
+    });
+
+    return new Controller();
+});
Index: Dev/branches/rest-dojo-ui/client/rft/app/Page.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/app/Page.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/app/Page.js	(revision 407)
@@ -0,0 +1,10 @@
+define([
+    'dojo/_base/declare',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dijit/layout/BorderContainer'
+],function(declare,_TemplatedMixin,_WidgetsInTemplateMixin,BorderContainer){
+    return declare([BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        templateString: '<div>Empty page.</div>'
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/content.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/content.js	(revision 406)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/** rft/ui/content - Load page content
- *
- * The rft/ui/content module is responsible for loading content in the app.
- * Content is loaded by calling:
- *    content.goTo('pageId');
- * The page is then loaded from pages/pageId.html. This should contain one top node.
- * This top node gets a _Page widget instantiated on it. The template should not
- * specify another widget on the topnode. A page controller can be specified by
- * the data-rft-mixin attribute to a class inherited from _PageController.
- * You can also specify methods in the template in script tags as:
- *     <script type="rft/method" data-rft-method-name="onVisit|onLeave">
- *        // code
- *     </script>
- * The two relevant events are onVisit and onLeave. After loading and starting
- * the complete page onVisit is called. Use this to link widgets together and
- * load any dynamic content not handled by widget logic already.
- * The event onLeave is called before navigating to another page. If false is 
- * returned from this function, the navigation will be cancelled. You can use 
- * this e.g. to ask confirmation if changed values are not saved.
- */
-define([
-    'dojo/_base/Deferred',
-    'dojo/_base/json',
-    'dojo/_base/lang',
-    'dojo/_base/xhr',
-    'dojo/dom-attr',
-    'dojo/dom-construct',
-    'dijit/registry',
-    './ui/_Page',
-    'dojo/domReady!'
-],function(Deferred,json,lang,xhr,attr,domConstruct,registry,_Page){
-    return new (function(){
-        var self = this;
-        var inited = false;
-
-        var okay = new Deferred();
-        okay.resolve();
-        okay = okay.promise;
-
-        var fail = new Deferred();
-        fail.reject("No implementation available.");
-        fail = fail.promise;
-
-        var contentPane = null;
-        self.goToImpl = null;
-        self.initialImpl = null;
-
-        self.init = function() {
-            contentPane = registry.byId('content');
-            inited = true;
-        };
-
-        self.goTo = function(path,args) {
-            if ( !inited ) { return fail; }
-            if ( self.goToImpl !== null ) {
-                return self.goToImpl(path,args);
-            } else {
-                return fail;
-            }
-        };
-
-        self.initial = function(path,args) {
-            if ( !inited ) { return fail; }
-            if ( self.initialImpl !== null ) {
-                return self.initialImpl(path,args);
-            } else {
-                return fail;
-            }
-        };
-
-        self._loadPage = function(path,args) {
-            if ( !inited ) { return fail; }
-            var dfd = new Deferred();
-
-            function getFirstNode(html) {
-                var nodeOrFragment = domConstruct.toDom(html);
-                if (nodeOrFragment instanceof Element) {
-                    return nodeOrFragment;
-                }
-                if (nodeOrFragment instanceof DocumentFragment) {
-                    console.warn("Fragment found, will only use first Element");
-                    for (var i in nodeOrFragment.childNodes) {
-                        var node = nodeOrFragment.childNodes[i];
-                        if (node instanceof Element) {
-                            return node;
-                        }
-                    }
-                }
-                return domConstruct.toDom('<div>No Element found in template.</div>');
-            }
-
-            function mixinArgs(node) {
-                var props = {};
-                if ( attr.has(node,'data-dojo-props') ) {
-                    props = json.fromJson(attr.get(node,'data-dojo-props'));
-                }
-                lang.mixin(props,{pageArgs:args});
-                var jsonStr = json.toJson(props);
-                attr.set(node,'data-dojo-props',jsonStr.slice(1,jsonStr.length-1));
-            }
-                
-            // load html
-            var pageUrl = 'rft/pages'+path+'.html';
-            xhr.get({
-                url: pageUrl,
-                failOk: true
-            })
-            // initialize page or create error message
-            .then(function(html){
-                var rootNode = getFirstNode(html);
-                mixinArgs(rootNode);
-                contentPane.set('content',rootNode);
-                var page = registry.byNode(rootNode);
-                if ( !page ) {
-                    page = new _Page({},rootNode);
-                }
-                dfd.resolve(page);
-            },function(){
-                contentPane.set('content',"<div>Page "+path+" not found.</div>");
-                dfd.reject();
-            });
-
-            return dfd.promise;
-        };
-
-    })();
-});
Index: Dev/branches/rest-dojo-ui/client/rft/css/external.css
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/css/external.css	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/css/external.css	(revision 407)
@@ -0,0 +1,4 @@
+@import url('../../dijit/themes/claro/claro.css');
+@import url('../../dojox/grid/resources/Grid.css');
+@import url('../../dojox/grid/resources/claroGrid.css');
+@import url('../../dojox/widget/Toaster/Toaster.css');
Index: Dev/branches/rest-dojo-ui/client/rft/css/main.css
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/css/main.css	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/css/main.css	(revision 407)
@@ -1,2 +1,3 @@
+@import url('external.css');
 @import url('claroOverride.css');
 
Index: Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticReadStore.js	(revision 407)
@@ -7,5 +7,5 @@
     ],function(declare, json, lang, xhr, QueryReadStore) {
 
-    return declare("rft.elastic.ElasticReadStore", QueryReadStore, {
+    return declare(QueryReadStore, {
         fetch:function(request){
             var attr = Object.keys(request.query)[0];
Index: Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/elastic/ElasticSearchFilteringSelect.js	(revision 407)
@@ -3,5 +3,5 @@
     'dijit/form/FilteringSelect'
 ], function(declare, FilteringSelect) {
-    return declare("rft.elastic.ElasticSearchFilteringSelect", FilteringSelect, {
+    return declare(FilteringSelect, {
          // custom min input character count to trigger search
          minKeyCount: 3,
Index: Dev/branches/rest-dojo-ui/client/rft/indexContent.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/indexContent.js	(revision 406)
+++ 	(revision )
@@ -1,117 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/Deferred',
-    'dojo/_base/lang',
-    'dojo/hash',
-    'dojo/topic',
-    'dojo/io-query',
-    './content',
-    './util',
-],function(declare,Deferred,lang,hash,topic,uriQuery,content,util){
-        return new (function() {
-
-            var HRI = declare(null,{
-                constructor: function() {
-                    this._path = this._fixPath('/');
-                    this._args = {};
-                    if ( arguments.length == 1 ) {
-                        this.hash(arguments[0]);
-                    } else if ( arguments.length == 2 ) {
-                        this.path(arguments[0]);
-                        this.args(arguments[1]);
-                    }
-                },
-                path: function(path) {
-                    if ( path )
-                        this._path = this._fixPath(path);
-                    return this._path;
-                },
-                args: function(args) {
-                    if ( args && lang.isObject(args) )
-                        this._args = args;
-                    return this._args;
-                },
-                hash: function(hash) {
-                    if ( hash && lang.isString(hash) ) {
-                        var parts = hash.split('!');
-                        if ( parts[1] )
-                            this._path = this._fixPath(parts[1]);
-                        if ( parts[2] )
-                            this._args = uriQuery.queryToObject(parts[2]);
-                    }
-                    return '!'+this._path+'!'+uriQuery.objectToQuery(this._args);
-                },
-                _fixPath: function(path) {
-                    if ( !lang.isString(path) || util.isEmptyString(path) ) {
-                        path = "/";
-                    }
-                    if ( path[0] != '/' ) {
-                        path = '/'+path;
-                    }
-                    if ( path[path.length-1] == '/' ) {
-                        path = path + "index";
-                    }
-                    return path;
-                }
-            });
-
-            var currentHri = null;
-            var currentPage = null;
-            
-            function _goTo(hri,replace) {
-                var dfd = new Deferred();
-                
-                // if already there, return
-                if ( currentHri && currentHri.hash() === hri.hash() ) {
-                    dfd.resolve();
-                    return dfd.promise;
-                }
-                
-                // check if we can leave current page
-                if ( currentPage ) {
-                    if ( currentPage.onLeave() === false ) {
-                        // restore hash if changed by hand or back button
-                        hash(currentHri.hash());
-                        dfd.reject();
-                        return dfd.promise;
-                    }
-                    currentPage = null;
-                }
-                
-                // update hash
-                currentHri = hri;
-                hash(hri.hash(),replace);
-                
-                content._loadPage(hri.path(),hri.args())
-                .then(function(page){
-                    currentPage = page;
-                    dfd.resolve();
-                });
-
-                return dfd.promise;
-            }
-
-            content.initialImpl = function(path,args) {
-                if ( currentHri ) {
-                    var dfd = new Deferred();
-                    dfd.resolve();
-                    return dfd.promise;
-                }
-                if ( hash() ) {
-                    var hri = new HRI(hash());
-                    return _goTo(hri, true);
-                } else {
-                    return _goTo(new HRI(path,args));
-                }
-            };
-
-            content.goToImpl = function(path,args) {
-                return _goTo(new HRI(path,args));
-            };
-
-            topic.subscribe('/dojo/hashchange', function(){
-                _goTo(new HRI(hash()));
-            });
-
-        })();
-    });
Index: Dev/branches/rest-dojo-ui/client/rft/package.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/package.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/package.js	(revision 407)
@@ -0,0 +1,15 @@
+var profile = (function(){
+    return {
+        resourceTags: {
+            amd: function (filename, mid) {
+                return /\.js$/.test(filename);
+            },
+            declarative: function (filename, mid) {
+                return /\.html$/.test(filename);
+            },
+            copyOnly: function(filename,mid) {
+                return false;
+            }
+        }
+    };
+})();
Index: Dev/branches/rest-dojo-ui/client/rft/package.json
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/package.json	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/package.json	(revision 407)
@@ -0,0 +1,10 @@
+{
+    "name": "rft",
+    "description": "Research Facilitator Tool",
+    "dependencies": {
+        "dojo": "~1.8.0",
+        "dijit": "~1.8.0",
+        "dojox": "~1.8.0"
+    },
+    "dojoBuild": "package.js"
+}
Index: Dev/branches/rest-dojo-ui/client/rft/pages/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/index.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/index.html	(revision 407)
@@ -1,74 +1,37 @@
-<div data-dojo-type="rft.pages.index">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 600px;">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconUser"></span>
-                <span class="headerText">Main Menu</span>
-            </h2>
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconUser"></span>
+            <span class="headerText">Main Menu</span>
+        </h2>
+    </div>
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+
+        <div class="rftIndexMenuBlock" title="Sessions">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconSession"></span><span class="label">Sessions</span>
+            </div>
+            <button data-dojo-attach-point="btnContentCreate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconPlus'">Create and edit</button>
+            <button data-dojo-attach-point="btnContentFacilitate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconForward'">Facilitate</button>
         </div>
 
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
+        <div class="rftIndexMenuBlock" title="Content">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconInspect"></span><span class="label">Content</span>
+            </div>
+            <button data-dojo-attach-point="btnSurveys" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue oneHeight', iconClass: 'rftIcon rftIconSurvey'">Surveys</button>
+            <button data-dojo-attach-point="btnQuestions" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'orange oneHeight', iconClass: 'rftIcon rftIconQuestion'">Questions</button>
+            <button data-dojo-attach-point="btnApplications" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'purple oneHeight', iconClass: 'rftIcon rftIconApplication'">Applications</button>
+            <button data-dojo-attach-point="btnDashboards" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'red oneHeight', iconClass: 'rftIcon rftIconDashboard'">Dashboards</button>
+        </div>
 
-            <div class="rftIndexMenuBlock" title="Sessions">
-                <div class="rftIndexMenuMask">
-                    <span class="rftIcon rftIconSession"></span><span class="label">Sessions</span>
-                </div>
-                <button data-rft-attach-point="btnContentCreate" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconPlus'">Create and edit</button>
-                <button data-rft-attach-point="btnContentFacilitate" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconForward'">Facilitate</button>
+        <div class="rftIndexMenuBlock" title="results">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconGameData"></span><span class="label">Results</span>
             </div>
-
-            <div class="rftIndexMenuBlock" title="Content">
-                <div class="rftIndexMenuMask">
-                    <span class="rftIcon rftIconInspect"></span><span class="label">Content</span>
-                </div>
-                <button data-rft-attach-point="btnSurveys" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue oneHeight', iconClass: 'rftIcon rftIconSurvey'">Surveys</button>
-                <button data-rft-attach-point="btnQuestions" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'orange oneHeight', iconClass: 'rftIcon rftIconQuestion'">Questions</button>
-                <button data-rft-attach-point="btnApplications" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'purple oneHeight', iconClass: 'rftIcon rftIconApplication'">Applications</button>
-                <button data-rft-attach-point="btnDashboards" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'red oneHeight', iconClass: 'rftIcon rftIconDashboard'">Dashboards</button>
-            </div>
-
-            <div class="rftIndexMenuBlock" title="results">
-                <div class="rftIndexMenuMask">
-                    <span class="rftIcon rftIconGameData"></span><span class="label">Results</span>
-                </div>
-                <button data-rft-attach-point="btnResults" data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue fourHeight', iconClass: 'rftIcon rftIconGameData'">Results</button>
-            </div>
+            <button data-dojo-attach-point="btnResults" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue fourHeight', iconClass: 'rftIcon rftIconGameData'">Results</button>
         </div>
     </div>
 
-    <script>
-    require([
-        'dojo/on',
-        'dojo/query',
-        'dijit/registry',
-        'rft/content',
-        'dojo/domReady!'
-        ], function(on, query, registry, content){
-            debugger;
-            registry.byId("btnSessionsCreate").on("click", function(){
-                content.goTo("sessions", null);
-            });
-            registry.byId("btnSessionsFacilitate").on("click", function(){
-                content.goTo("sessions", null);
-            });
-
-            registry.byId("btnSurveys").on("click", function(){
-                content.goTo("surveys", null);
-            });
-            registry.byId("btnQuestions").on("click", function(){
-                content.goTo("questions", null);
-            });
-            registry.byId("btnApplications").on("click", function(){
-                content.goTo("applications", null);
-            });
-            registry.byId("btnDashboards").on("click", function(){
-                content.goTo("dashboards", null);
-            });
-
-            registry.byId("btnResults").on("click", function(){
-                content.goTo("results", null);
-            });
-
-        });
-    </script>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/index.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/index.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/index.js	(revision 407)
@@ -1,16 +1,22 @@
-define(['dojo/_base/declare','dojo/_base/lang','rft/content','rft/ui/_Page'],
-    function(declare,lang,content,_Page){
-        return declare('rft.pages.index',[_Page],{
-            selectedObject: null,
-            onVisit: function() {
-                this.btnContentCreate.on("click",function(){ content.goTo("sessions"); });
-                this.btnContentFacilitate.on("click",function(){ content.goTo("run"); });
-                this.btnSurveys.on("click",function(){ content.goTo("surveys"); });
-                this.btnQuestions.on("click",function(){ content.goTo("questions"); });
-                this.btnApplications.on("click",function(){ content.goTo("applications"); });
-                this.btnDashboards.on("click",function(){ content.goTo("dashboards"); });
-                this.btnResults.on("click",function(){ content.goTo("results"); });
-            }
-        });
+define([
+    'dojo/_base/declare',
+    '../app/Controller',
+    '../app/Page',
+    'dojo/text!./index.html'
+],function(declare,Controller,Page,template){
+    return declare([Page],{
+        templateString: template,
+        selectedObject: null,
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            this.btnContentCreate.on("click",function(){ Controller.go("/sessions"); });
+            this.btnContentFacilitate.on("click",function(){ Controller.go("/run"); });
+            this.btnSurveys.on("click",function(){ Controller.go("/surveys"); });
+            this.btnQuestions.on("click",function(){ Controller.go("/questions"); });
+            this.btnApplications.on("click",function(){ Controller.go("/applications"); });
+            this.btnDashboards.on("click",function(){ Controller.go("/dashboards"); });
+            this.btnResults.on("click",function(){ Controller.go("/results"); });
+        }
     });
-
+});
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/question.html	(revision 407)
@@ -1,21 +1,20 @@
-<div data-dojo-type="rft.pages.question" class="orange">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconSurvey"></span>
-                <span class="headerText">Question 123 [Editing]</span>
-            </h2>
+<div class="orange">
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText">Question 123 [Editing]</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'left', design:'headline'" style="width: 300px;">
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+            <div data-dojo-attach-point="QuestionEditorToolkitNode"></div>
         </div>
-        <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'left', design:'headline'" style="width: 300px;">
-            <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
-                <div data-rft-attach-point="QuestionEditorToolkitNode"></div>
-            </div>
-            <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-                <button data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'" data-rft-attach-event="onClick:_onDiscard">Discard</button>
-                <button data-dojo-type="dijit.form.Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'" data-rft-attach-event="onClick:_onSave">Save and exit</button>
-            </div>
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'" data-dojo-attach-event="onClick:_onDiscard">Discard</button>
+            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'" data-dojo-attach-event="onClick:_onSave">Save and exit</button>
         </div>
-        <div data-rft-attach-point="QuestionEditorPreviewNode"></div>
-
+    </div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="QuestionEditorPreviewNode"></div>
     </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 407)
@@ -4,61 +4,63 @@
     'dojo/_base/event',
     'dojo/_base/lang',
-    'rft/store',
-    'rft/content',
-    'rft/ui/_Page',
-    'rft/ui/QuestionEditorPreview',
-    'rft/ui/QuestionEditorToolkit'
-    ],function(declare, Deferred, event, lang, store, content, _Page, QuestionEditorPreview, QuestionEditorToolkit){
-        return declare('rft.pages.question', [_Page], {
-            question: null,
-            _toolkit: null,
-            _preview: null,
-            
-            onVisit: function() {
-                if (this.pageArgs.uid) {
-                    Deferred.when(store.get(this.pageArgs.uid))
-                    .then(lang.hitch(this, function(obj) {
-                        this.question = obj;
-                        this._refresh();
-                    }));
-                } else {
-                    throw new Error("Error: no reference to object set!");
-                }
-                this._setupEditor();
-            },
-            onLeave: function() {
-                this.inherited(arguments);
-            },
-            _refresh: function () {
-                this._toolkit.set('value',this.question);
-                this._preview.appendItems(this.question.content || []);
-            },
-            _onSave: function(evt) {
-                lang.mixin(this.question, this._toolkit.get('value'));
-                this.question.content = this._preview.getItems();
-                store.put(this.question)
-                .then(function() {
-                    content.goTo('questions');
-                });
-                evt && event.stop( evt );
-                return false;
-            },
-            _onDiscard: function() {
-                content.goTo('questions');
-                return true;
-            },
-            _setupEditor: function() {
-                this._toolkit = new QuestionEditorToolkit({
-                },this.QuestionEditorToolkitNode);
-                this._toolkit.on('submit',lang.hitch(this,"_onSave"));
-                this._toolkit.startup();
+    '../store',
+    '../app/Controller',
+    '../app/Page',
+    '../ui/QuestionEditorPreview',
+    '../ui/QuestionEditorToolkit',
+    'dojo/text!./question.html'
+],function(declare, Deferred, event, lang, store, Controller, Page, QuestionEditorPreview, QuestionEditorToolkit, template){
+    return declare([Page], {
+        templateString: template,
+        question: null,
+        _toolkit: null,
+        _preview: null,
+        
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            if (this.questionId) {
+                Deferred.when(store.get(this.questionId))
+                .then(lang.hitch(this, function(obj) {
+                    this.question = obj;
+                    this._refresh();
+                }));
+            } else {
+                throw new Error("Error: no reference to object set!");
+            }
+            this._setupEditor();
+        },
+        onLeave: function() {
+            this.inherited(arguments);
+        },
+        _refresh: function () {
+            this._toolkit.set('value',this.question);
+            this._preview.appendItems(this.question.content || []);
+        },
+        _onSave: function(evt) {
+            lang.mixin(this.question, this._toolkit.get('value'));
+            this.question.content = this._preview.getItems();
+            store.put(this.question)
+            .then(function() {
+                Controller.go('/questions');
+            });
+            evt && event.stop( evt );
+            return false;
+        },
+        _onDiscard: function() {
+            Controller.go('/questions');
+            return true;
+        },
+        _setupEditor: function() {
+            this._toolkit = new QuestionEditorToolkit({
+            },this.QuestionEditorToolkitNode);
+            this._toolkit.on('submit',lang.hitch(this,"_onSave"));
+            this._toolkit.startup();
 
-                this._preview = new QuestionEditorPreview({ 
-                    region: 'center'
-                },this.QuestionEditorPreviewNode);
-                this._preview.startup();
-                this._supportingWidgets.push(this._toolkit, this._preview);
-            }
-        });
+            this._preview = new QuestionEditorPreview({ 
+            },this.QuestionEditorPreviewNode);
+            this._preview.startup();
+            this._supportingWidgets.push(this._toolkit, this._preview);
+        }
+    });
 });
-
Index: Dev/branches/rest-dojo-ui/client/rft/pages/questions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/questions.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/questions.html	(revision 407)
@@ -1,20 +1,18 @@
-<div data-dojo-type="rft.pages.questions" class="blue">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
+<div class="blue">
 
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconQuestion"></span>
-                <span class="headerText">Questions</span>
-            </h2>
-        </div>
-        
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
-            <div data-rft-attach-point="questionBrowser"></div>
-        </div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconQuestion"></span>
+            <span class="headerText">Questions</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="questionBrowser"></div>
+    </div>
 
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
-            <div data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onNewQuestion" data-dojo-props="baseClass: 'rftLargeButton', iconClass:'rftIcon rftIconQuestion'">New question</div>
-        </div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
+        <div data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onNewQuestion" data-dojo-props="baseClass: 'rftLargeButton', iconClass:'rftIcon rftIconQuestion'">New question</div>
+    </div>
 
-    </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/questions.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 407)
@@ -4,42 +4,43 @@
     'dojo/_base/event',
     'dojo/_base/lang',
-    'rft/content',
-    'rft/store',
-    'rft/ui/_Page',
-    'rft/ui/TabbedQuestionBrowser'
-    ],function(declare,Deferred,event,lang,content,store,_Page,TabbedQuestionBrowser) {
-        return declare('rft.pages.questions',[_Page],{
-            constructor: function() {
-                this.inherited(arguments);
-            },
-            onVisit: function() {
-                this.questionBrowser = new TabbedQuestionBrowser({
-                    region: 'center',
-                    'class': 'blue',
-                    itemActions: {
-                        'Edit': {
-                            callback: lang.hitch(this,"onEditQuestion"),
-                               icon: 'Edit',
-                               description: 'Edit question'
-                        }
+    '../app/Controller',
+    '../store',
+    '../app/Page',
+    '../ui/TabbedQuestionBrowser',
+    'dojo/text!./questions.html'
+],function(declare,Deferred,event,lang,Controller,store,Page,TabbedQuestionBrowser,template) {
+    return declare([Page],{
+        templateString: template,
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            this.questionBrowser = new TabbedQuestionBrowser({
+                region: 'center',
+                'class': 'blue',
+                itemActions: {
+                    'Edit': {
+                        callback: lang.hitch(this,"onEditQuestion"),
+                           icon: 'Edit',
+                           description: 'Edit question'
                     }
-                },this.questionBrowser);
-                this.questionBrowser.startup();
-            },
-            _refresh: function() {
-                Deferred.when(store.query('_design/default/_view/by_type',{key: 'Question'}))
-                .then(lang.hitch(this,function(items){
-                    this._list.setItems(items);
-                }));
-            },
-            onNewQuestion: function() {
-                Deferred.when(store.add({type:'Question'}))
-                .then(lang.hitch(this,function(question){
-                    this.onEditQuestion(question);
-                }));
-            },
-            onEditQuestion: function(question) {
-                content.goTo("question", {uid: question._id});
-            }
-        });
+                }
+            },this.questionBrowser);
+            this.questionBrowser.startup();
+        },
+        _refresh: function() {
+            Deferred.when(store.query('_design/default/_view/by_type',{key: 'Question'}))
+            .then(lang.hitch(this,function(items){
+                this._list.setItems(items);
+            }));
+        },
+        onNewQuestion: function() {
+            Deferred.when(store.add({type:'Question'}))
+            .then(lang.hitch(this,function(question){
+                this.onEditQuestion(question);
+            }));
+        },
+        onEditQuestion: function(question) {
+            Controller.go("/question/"+question._id);
+        }
+    });
 });
Index: Dev/branches/rest-dojo-ui/client/rft/pages/session.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/session.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/session.html	(revision 407)
@@ -1,55 +1,53 @@
-<div data-dojo-type="rft.pages.session">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconSurvey"></span>
-                <span data-rft-attach-point="titleNode" class="headerText">Untitled</span><span class="headerText"> [editing]</span>
-            </h2>
-        </div>
-        <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'">
-            <div data-dojo-type="dijit.layout.TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
-                <div data-dojo-type="dijit.layout.ContentPane" title="Properties">
-                    <div data-dojo-type="dijit.form.Form" data-rft-attach-point="propertiesForm" data-rft-attach-event="onSubmit:onSave">
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span data-dojo-attach-point="titleNode" class="headerText">Untitled</span><span class="headerText"> [editing]</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
+            <div data-dojo-type="dijit/layout/ContentPane" title="Properties">
+                <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm" data-dojo-attach-event="onSubmit:onSave">
 
-                        <h3>Basic</h3>
-                        <fieldset class="align">
-                            <label for="title">Title</label>
-                            <input type="text" name="title" data-dojo-type="dijit.form.TextBox" data-dojo-props="placeHolder: 'Enter title here'" />
-                            <br/>
-                            <label for="description">Description</label>
-                            <textarea name="description" rows="3" cols="54" data-dojo-type="dijit.form.SimpleTextarea" data-dojo-props="selectOnClick: true, placeHolder: 'Description shown in tooltips'"></textarea>
-                            <br/>
-                            <label for="plannedDate">Planned date</label>
-                            <input type="text" name="plannedDate" data-dojo-type="dijit.form.DateTextBox" required="required" />
-                        </fieldset>
+                    <h3>Basic</h3>
+                    <fieldset class="align">
+                        <label for="title">Title</label>
+                        <input type="text" name="title" data-dojo-type="dijit/form/TextBox" data-dojo-props="placeHolder: 'Enter title here'" />
+                        <br/>
+                        <label for="description">Description</label>
+                        <textarea name="description" rows="3" cols="54" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="selectOnClick: true, placeHolder: 'Description shown in tooltips'"></textarea>
+                        <br/>
+                        <label for="plannedDate">Planned date</label>
+                        <input type="text" name="plannedDate" data-dojo-type="dijit/form/DateTextBox" required="required" />
+                    </fieldset>
 
-                        <h3>Accounts</h3>
-                        <fieldset class="align">
-                            <label for="accountSelector">Add new</label>
-                            <select data-rft-attach-point="accountSelector"></select>
-                            <button data-rft-attach-point="btnInvite" data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onInvite" data-dojo-props="baseClass: 'rftBlockButton', class: 'green', iconClass: 'rftIcon rftIconPlus'">Invite</button>
-                            <br/><br/>
-                            
-                            <div data-rft-attach-point="accountListNode" class="rftAccountListView">
-                            </div>
-                        </fieldset>
+                    <h3>Accounts</h3>
+                    <fieldset class="align">
+                        <label for="accountSelector">Add new</label>
+                        <select data-dojo-attach-point="accountSelector"></select>
+                        <button data-dojo-attach-point="btnInvite" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onInvite" data-dojo-props="baseClass: 'rftBlockButton', class: 'green', iconClass: 'rftIcon rftIconPlus'">Invite</button>
+                        <br/><br/>
+                        
+                        <div data-dojo-attach-point="accountListNode" class="rftAccountListView">
+                        </div>
+                    </fieldset>
 
-                        <button data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onDiscard" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">Discard changes</button>
-                        <button data-dojo-type="dijit.form.Button" data-rft-attach-event="onClick:onSave" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">Save changes</button>
-
-                    </div>
+                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onDiscard" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">Discard changes</button>
+                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onSave" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">Save changes</button>
 
                 </div>
-                <div data-dojo-type="dijit.layout.ContentPane" title="Design">
-                    <div class="rftSessionObject green">
-                        <div class="rftIcon rftIconSurvey"></div>
-                        <label>Survey name</label>
-                    </div>
-                    <div class="rftSessionObject green">
-                        <div class="rftIcon rftIconSurvey"></div>
-                        <label>Survey name, this one is really long.</label>
-                    </div>
 
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" title="Design">
+                <div class="rftSessionObject green">
+                    <div class="rftIcon rftIconSurvey"></div>
+                    <label>Survey name</label>
                 </div>
+                <div class="rftSessionObject green">
+                    <div class="rftIcon rftIconSurvey"></div>
+                    <label>Survey name, this one is really long.</label>
+                </div>
+
             </div>
         </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/session.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 407)
@@ -5,86 +5,89 @@
     'dojo/_base/event',
     'dojo/_base/Deferred',
-    '../content',
+    '../app/Controller',
     '../store',
     '../elastic/ElasticSearchFilteringSelect',
     '../elastic/ElasticReadStore',
-    '../ui/_Page',
-    '../ui/lists/AccountListView'
-    ],
-    function(array,declare,lang,event,Deferred,ElasticSearchFilteringSelect,ElasticReadStore,store,_Page,content,AccountListView){
-        return declare('rft.pages.session',[_Page],{
-            session: null,
-            _accountList: null,
-            _select: null,
-            onVisit: function() {
-                if ( this.pageArgs.uid ) {
-                    Deferred.when(store.get(this.pageArgs.uid))
-                    .then(lang.hitch(this,function(obj){
-                        this.session = obj;
-                        this._setupAccountList();
-                        this._refresh();
-                    }));
-                    this._setupAutoComplete();
-                } else {
-                    throw "No valid uid or session passed!";
-                }
-            },
-            _refresh: function() {
-                this.titleNode.innerHTML = this.session.title || '';
-                this.propertiesForm.set('value',this.session);
-            },
-            onInvite: function() {
-                this._addAccount(this._select.item.i);
-                this._select.reset();
-            },
-            onSave: function(evt) {
-                lang.mixin(this.session,this.propertiesForm.get('value'));
-                this.session.accounts = array.map(this._accountList.getItems(),function(item){
-                    return store.getIdentity(item);
-                });
-                store.put(this.session)
-                .then(function(){
-                    content.goTo('sessions');
-                });
-                event.stop(evt);
-                return false;
-            },
-            onDiscard: function(evt) {
-                this.propertiesForm.reset();
-                event.stop(evt);
-                content.goTo('sessions');
-                return false;
-            },
-            _addAccount: function(item) {
-                this._accountList.insertItem(item);
-            },
-            _setupAccountList: function() {
-                this._accountList = new AccountListView().placeAt(this.accountListNode);
-                this._accountList.startup();
-                for (var account in this.session.accounts) {
-                    this._accountList.insertItem(this.session.accounts[account]);
-                }
-            },
-            _setupAutoComplete: function() {
-                var accountStore = new ElasticReadStore({
-                    url: "http://localhost:9200/rft/_search",
-                    requestMethod: "POST"
-                });
-                this._select = new ElasticSearchFilteringSelect({
-                    store: accountStore,
-                    autoComplete: false,
-                    required: false,
-                    labelType: "text",
-                    placeHolder: "Enter email address here...",
-                    pageSize: 10,
-                    hasDownArrow: false,
-                    style: "width: 400",
-                    searchAttr: "title"
-                }, this.accountSelector);
-                this._select.startup();
+    '../app/Page',
+    '../ui/lists/AccountListView',
+    'dojo/text!./session.html'
+],function(array,declare,lang,event,Deferred,ElasticSearchFilteringSelect,ElasticReadStore,store,Page,Controller,AccountListView,template){
+    return declare([Page],{
+        templateString: template,
+        session: null,
+        _accountList: null,
+        _select: null,
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            if ( this.sessionId ) {
+                Deferred.when(store.get(this.sessionId))
+                .then(lang.hitch(this,function(obj){
+                    this.session = obj;
+                    this._setupAccountList();
+                    this._refresh();
+                }));
+                this._setupAutoComplete();
+            } else {
+                throw "No valid uid or session passed!";
             }
+        },
+        _refresh: function() {
+            this.titleNode.innerHTML = this.session.title || '';
+            this.propertiesForm.set('value',this.session);
+        },
+        onInvite: function() {
+            this._addAccount(this._select.item.i);
+            this._select.reset();
+        },
+        onSave: function(evt) {
+            lang.mixin(this.session,this.propertiesForm.get('value'));
+            this.session.accounts = array.map(this._accountList.getItems(),function(item){
+                return store.getIdentity(item);
+            });
+            store.put(this.session)
+            .then(function(){
+                Controller.go('/sessions');
+            });
+            event.stop(evt);
+            return false;
+        },
+        onDiscard: function(evt) {
+            this.propertiesForm.reset();
+            event.stop(evt);
+            Controller.go('/sessions');
+            return false;
+        },
+        _addAccount: function(item) {
+            this._accountList.insertItem(item);
+        },
+        _setupAccountList: function() {
+            this._accountList = new AccountListView().placeAt(this.accountListNode);
+            this._accountList.startup();
+            for (var account in this.session.accounts) {
+                this._accountList.insertItem(this.session.accounts[account]);
+            }
+        },
+        _setupAutoComplete: function() {
+            var accountStore = new ElasticReadStore({
+                url: "http://localhost:9200/rft/_search",
+                requestMethod: "POST"
+            });
+            this._select = new ElasticSearchFilteringSelect({
+                store: accountStore,
+                autoComplete: false,
+                required: false,
+                labelType: "text",
+                placeHolder: "Enter email address here...",
+                pageSize: 10,
+                hasDownArrow: false,
+                style: "width: 400",
+                searchAttr: "title"
+            }, this.accountSelector);
+            this._select.startup();
+        }
 
 
-        });
     });
+});
 
Index: Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html	(revision 407)
@@ -1,25 +1,23 @@
-<div data-dojo-type="rft.pages.sessions">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconSession"></span>
-                <span class="headerText">Sessions</span>
-            </h2>
-        </div>
-        <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'">
-            <div data-rft-attach-point="tabContainer" data-dojo-type="dijit.layout.TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
-                <div data-dojo-type="dijit.layout.BorderContainer" title="Templates" data-rft-attach-point="templatesTab">
-                    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'" data-rft-attach-point="containerTemplates">
-                    </div>
-                    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-                        <div data-dojo-type="dijit.form.Button" data-dojo-props="region: 'bottom', baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconSessionTemplate'" data-rft-attach-event="onClick:onAddSessionTemplate">Create new template</div>
-                    </div>
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSession"></span>
+            <span class="headerText">Sessions</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
+            <div data-dojo-type="dijit/layout/BorderContainer" title="Templates" data-dojo-attach-point="templatesTab">
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerTemplates">
                 </div>
-                <div data-dojo-type="dijit.layout.ContentPane" title="Sessions" data-rft-attach-point="sessionsTab">
-                    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'" data-rft-attach-point="containerSessions">
-                    </div>
-                    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-                        <!-- Buttons? -->
-                    </div>
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+                    <div data-dojo-type="dijit/form/Button" data-dojo-props="region: 'bottom', baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconSessionTemplate'" data-dojo-attach-event="onClick:onAddSessionTemplate">Create new template</div>
+                </div>
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" title="Sessions" data-dojo-attach-point="sessionsTab">
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerSessions">
+                </div>
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+                    <!-- Buttons? -->
                 </div>
             </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js	(revision 407)
@@ -3,76 +3,79 @@
     'dojo/_base/lang',
     'dojo/date/stamp',
-    'rft/store',
-    'rft/content',
-    'rft/ui/_Page',
-    'rft/ui/ObjectBox'],
-    function(declare,lang,dateStamp,store,content,_Page,ObjectBox){
-        return declare('rft.pages.sessions',[_Page],{
-            templateActions: null,
-            sessionActions: null,
-            onVisit: function() {
-                this.templateActions = {
-                    "Edit": function(obj){
-                        content.goTo('session',{uid:store.getIdentity(obj)});
-                    },
-                    "Delete": lang.hitch(this,function(obj){
-                        store.remove(store.getIdentity(obj),store.getRevision(obj))
-                        .then(lang.hitch(this,function(){
-                            this._refresh();
-                        }));
-                    }),
-                    "Publish": lang.hitch(this,this._publishSession)
-                };
-                this.sessionActions = {
-                    "Facilitate": function(obj){
-                        content.goTo('run',{uid:store.getIdentity(obj)});
-                    },
-                    "Delete": lang.hitch(this,function(obj){
-                        store.remove(store.getIdentity(obj),store.getRevision(obj))
-                        .then(lang.hitch(this,function(){
-                            this._refresh();
-                        }));
-                    })
-                };
+    '../store',
+    '../app/Controller',
+    '../app/Page',
+    '../ui/ObjectBox',
+    'dojo/text!./sessions.html'
+],function(declare,lang,dateStamp,store,Controller,Page,ObjectBox,template){
+    return declare([Page],{
+        templateString: template,
+        templateActions: null,
+        sessionActions: null,
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            this.templateActions = {
+                "Edit": function(obj){
+                    Controller.go('/session/'+store.getIdentity(obj));
+                },
+                "Delete": lang.hitch(this,function(obj){
+                    store.remove(store.getIdentity(obj),store.getRevision(obj))
+                    .then(lang.hitch(this,function(){
+                        this._refresh();
+                    }));
+                }),
+                "Publish": lang.hitch(this,this._publishSession)
+            };
+            this.sessionActions = {
+                "Facilitate": function(obj){
+                    Controller.go('run',{uid:store.getIdentity(obj)});
+                },
+                "Delete": lang.hitch(this,function(obj){
+                    store.remove(store.getIdentity(obj),store.getRevision(obj))
+                    .then(lang.hitch(this,function(){
+                        this._refresh();
+                    }));
+                })
+            };
+            this._refresh();
+        },
+        _refresh: function() {
+            this.containerTemplates.set('content','');
+            this.containerSessions.set('content','');
+            this._refreshByType('SessionTemplate',this.containerTemplates.domNode,this.templateActions);
+            this._refreshByType('SessionInstance',this.containerSessions.domNode,this.sessionActions);
+        },
+        _refreshByType: function(type,container,actions) {
+            store.query("_design/default/_view/by_type",{key:type})
+            .forEach(lang.hitch(this,function(obj){
+                var widget = new ObjectBox({
+                    actions: actions
+                }).placeAt(container, "last");
+                widget.startup();
+                widget.set('value',obj);
+            }));
+        },
+        onAddSessionTemplate: function(){
+            store.put({
+                type: 'SessionTemplate'
+            })
+            .then(lang.hitch(this,function(obj){
+                Controller.go('/session/'+store.getIdentity(obj));
+            }));
+        },
+        _publishSession: function(sessionTemplate) {
+            var session = lang.clone(sessionTemplate);
+            delete session[store.idProperty];
+            delete session[store.revProperty];
+            session.type = "SessionInstance";
+            session.publishedDate = dateStamp.toISOString(new Date(),{zulu: true});
+            session.creator = "Igor Mayer";
+            store.add(session)
+            .then(lang.hitch(this,function(){
                 this._refresh();
-            },
-            _refresh: function() {
-                this.containerTemplates.set('content','');
-                this.containerSessions.set('content','');
-                this._refreshByType('SessionTemplate',this.containerTemplates.domNode,this.templateActions);
-                this._refreshByType('SessionInstance',this.containerSessions.domNode,this.sessionActions);
-            },
-            _refreshByType: function(type,container,actions) {
-                store.query("_design/default/_view/by_type",{key:type})
-                .forEach(lang.hitch(this,function(obj){
-                    var widget = new ObjectBox({
-                        actions: actions
-                    }).placeAt(container, "last");
-                    widget.startup();
-                    widget.set('value',obj);
-                }));
-            },
-            onAddSessionTemplate: function(){
-                store.put({
-                    type: 'SessionTemplate'
-                })
-                .then(lang.hitch(this,function(obj){
-                    content.goTo('session',{uid:store.getIdentity(obj)});
-                }));
-            },
-            _publishSession: function(sessionTemplate) {
-                var session = lang.clone(sessionTemplate);
-                delete session[store.idProperty];
-                delete session[store.revProperty];
-                session.type = "SessionInstance";
-                session.publishedDate = dateStamp.toISOString(new Date(),{zulu: true});
-                session.creator = "Igor Mayer";
-                store.add(session)
-                .then(lang.hitch(this,function(){
-                    this._refresh();
-                    this.tabContainer.selectChild(this.sessionsTab);
-                }));
-            }
-        });
+                this.tabContainer.selectChild(this.sessionsTab);
+            }));
+        }
     });
-
+});
Index: Dev/branches/rest-dojo-ui/client/rft/pages/survey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/survey.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/survey.html	(revision 407)
@@ -1,64 +1,62 @@
-<div data-dojo-type="rft.pages.survey" class="blue">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
+<div class="blue">
 
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconSurvey"></span>
-                <span class="headerText" data-rft-attach-point="titleNode">Survey Editor</span>
-            </h2>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText" data-dojo-attach-point="titleNode">Survey Editor</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="questionBrowser"></div>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'right'" style="width: 300px">
+        <div data-dojo-attach-point="surveyListViewNode" class="rftSurveyListView">
         </div>
-        
-        <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'">
-            <div data-rft-attach-point="questionBrowser"></div>
+
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'">
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onShowProperties"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconProperties'">
+                Properties</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onSave"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">
+                Save Changes</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onDiscard"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">
+                Discard changes</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onShowPreview"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconPreview'">
+                Preview</button>
         </div>
-        
-        <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'right'" style="width: 300px">
-            <div data-rft-attach-point="surveyListViewNode" class="rftSurveyListView">
-            </div>
 
-            <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'">
-                <button data-dojo-type="dijit.form.Button"
-                        data-rft-attach-event="onClick:_onShowProperties"
-                        data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconProperties'">
-                    Properties</button>
-                <button data-dojo-type="dijit.form.Button"
-                        data-rft-attach-event="onClick:_onSave"
-                        data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">
-                    Save Changes</button>
-                <button data-dojo-type="dijit.form.Button"
-                        data-rft-attach-event="onClick:_onDiscard"
-                        data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">
-                    Discard changes</button>
-                <button data-dojo-type="dijit.form.Button"
-                        data-rft-attach-event="onClick:_onShowPreview"
-                        data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconPreview'">
-                    Preview</button>
-            </div>
-        </div>
-    </div>
+    <div data-dojo-type="dijit/Dialog"
+         title="Survey properties"
+         data-dojo-attach-point="propertiesDialog"
+         data-dojo-attach-event="onSubmit:_onPropertiesOk">
 
-    <div data-dojo-type="dijit.Dialog"
-         title="Survey properties"
-         data-rft-attach-point="propertiesDialog"
-         data-rft-attach-event="onSubmit:_onPropertiesOk">
-
-        <form data-dojo-type="dijit.form.Form"
-              data-rft-attach-point="propertiesForm">
+        <form data-dojo-type="dijit/form/Form"
+              data-dojo-attach-point="propertiesForm">
             <label for="title">Title</label>
-            <input data-dojo-type="dijit.form.TextBox" name="title"/><br/>
+            <input data-dojo-type="dijit/form/TextBox" name="title"/><br/>
             <label for="description">Description</label>
-            <input data-dojo-type="dijit.form.Textarea" name="description"/><br/>
+            <input data-dojo-type="dijit/form/Textarea" name="description"/><br/>
         </form>
             
         <div>
-            <button data-dojo-type="dijit.form.Button"
+            <button data-dojo-type="dijit/form/Button"
                     type="submit"
-                    data-rft-attach-event="onClick:_onPropertiesOk">
+                    data-dojo-attach-event="onClick:_onPropertiesOk">
                 OK</button>
-            <button data-dojo-type="dijit.form.Button"
+            <button data-dojo-type="dijit/form/Button"
                     type="button"
-                    data-rft-attach-event="onClick:_onPropertiesCancel">
+                    data-dojo-attach-event="onClick:_onPropertiesCancel">
                 Cancel</button>
         </div>
+
     </div>
 
Index: Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 407)
@@ -5,101 +5,104 @@
     'dojo/_base/event',
     'dojo/_base/lang',
-    '../content',
+    '../app/Controller',
     '../store',
-    '../ui/_Page',
+    '../app/Page',
     '../ui/lists/QuestionListView',
-    '../ui/TabbedQuestionBrowser'
-    ],
-    function(array,declare,Deferred,event,lang,content,store,_Page,
-             QuestionListView,TabbedQuestionBrowser){
-        return declare('rft.pages.survey',[_Page],{
-            survey: null,
-            questionList: null,
-            _dataMap: null,
-            constructor: function(){
-                this._dataMap = {};
-            },
-            onVisit: function() {
-                if ( this.pageArgs.uid ) {
-                    this._setupQuestionBrowser();
-                    this._setupListView();
-                    Deferred.when(store.get(this.pageArgs.uid))
-                    .then(lang.hitch(this,function(obj){
-                        this.survey = obj;
-                        store.query(null,{keys:this.survey.questions,include_docs:true})
-                        .forEach(lang.hitch(this.questionList,'appendItem'));
-                        this.refresh();
-                    }));
-                } else {
-                    throw "No valid uid or survey passed!";
+    '../ui/TabbedQuestionBrowser',
+    'dojo/text!./survey.html'
+],function(array,declare,Deferred,event,lang,Controller,store,Page,
+         QuestionListView,TabbedQuestionBrowser,template){
+    return declare([Page],{
+        templateString: template,
+        survey: null,
+        questionList: null,
+        _dataMap: null,
+        constructor: function(){
+            this._dataMap = {};
+        },
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            if ( this.surveyId ) {
+                this._setupQuestionBrowser();
+                this._setupListView();
+                Deferred.when(store.get(this.surveyId))
+                .then(lang.hitch(this,function(obj){
+                    this.survey = obj;
+                    store.query(null,{keys:this.survey.questions,include_docs:true})
+                    .forEach(lang.hitch(this.questionList,'appendItem'));
+                    this.refresh();
+                }));
+            } else {
+                throw "No valid uid or survey passed!";
+            }
+        },
+        _setupQuestionBrowser: function() {
+            this.questionBrowser = new TabbedQuestionBrowser({
+                region: 'center',
+                'class': 'blue',
+                selectedActions: {
+                    "Include": {
+                        callback: lang.hitch(this,this._includeQuestion),
+                        icon: "Accept",
+                        description: "Include in survey"
+                    }
+                },
+                itemActions: {
+                    "Info": {
+                        callback: function(item){ item.description && alert(item.description); },
+                        icon: "Inspect",
+                        description: "Show item description"
+                    }
                 }
-            },
-            _setupQuestionBrowser: function() {
-                this.questionBrowser = new TabbedQuestionBrowser({
-                    region: 'center',
-                    'class': 'blue',
-                    selectedActions: {
-                        "Include": {
-                            callback: lang.hitch(this,this._includeQuestion),
-                            icon: "Accept",
-                            description: "Include in survey"
-                        }
-                    },
-                    itemActions: {
-                        "Info": {
-                            callback: function(item){ item.description && alert(item.description); },
-                            icon: "Inspect",
-                            description: "Show item description"
-                        }
-                    }
-                },this.questionBrowser);
-                this.questionBrowser.startup();
-            },
-            _includeQuestion: function(question) {
-                this.questionList.insertItem(question);
-            },
-            _setupListView: function() {
-                this.questionList = new QuestionListView({
-                    region: 'center'
-                },this.surveyListViewNode);
-                this.questionList.startup();
-            },
-            refresh: function() {
-                this.titleNode.innerHTML = this.survey.title || "(set title in properties)";
-                this.propertiesForm.set('value',this.survey);
-            },
-            _onShowProperties: function(evt) {
-                this.propertiesDialog.show();
-            },
-            _onPropertiesOk: function(evt) {
-                this.propertiesDialog.hide();
-                lang.mixin(this.survey, this.propertiesForm.get('value'));
-                this.refresh();
-                event.stop(evt);
-                return false;
-            },
-            _onPropertiesCancel: function(evt) {
-                this.propertiesDialog.hide();
-                this.propertiesForm.set('value',this.survey);
-                event.stop(evt);
-                return false;
-            },
-            _onSave: function(evt) {
-                this.survey.questions = array.map(this.questionList.getItems(),function(item){
-                    return store.getIdentity(item);
-                });
-                store.put(this.survey)
-                .then(function() { 
-                    content.goTo('surveys');
-                });
-                event.stop(evt);
-                return false;
-            },
-            _onDiscard: function(evt) {
-            },
-            _onShowPreview: function() {
-                content.goTo('viewSurvey', {uid: store.getIdentity(this.survey)});
-            }
-        });
+            },this.questionBrowser);
+            this.questionBrowser.startup();
+        },
+        _includeQuestion: function(question) {
+            this.questionList.insertItem(question);
+        },
+        _setupListView: function() {
+            this.questionList = new QuestionListView({
+                region: 'center'
+            },this.surveyListViewNode);
+            this.questionList.startup();
+        },
+        refresh: function() {
+            this.titleNode.innerHTML = this.survey.title || "(set title in properties)";
+            this.propertiesForm.set('value',this.survey);
+        },
+        _onShowProperties: function(evt) {
+            this.propertiesDialog.show();
+        },
+        _onPropertiesOk: function(evt) {
+            this.propertiesDialog.hide();
+            lang.mixin(this.survey, this.propertiesForm.get('value'));
+            this.refresh();
+            event.stop(evt);
+            return false;
+        },
+        _onPropertiesCancel: function(evt) {
+            this.propertiesDialog.hide();
+            this.propertiesForm.set('value',this.survey);
+            event.stop(evt);
+            return false;
+        },
+        _onSave: function(evt) {
+            this.survey.questions = array.map(this.questionList.getItems(),function(item){
+                return store.getIdentity(item);
+            });
+            store.put(this.survey)
+            .then(function() { 
+                Controller.go('/surveys');
+            });
+            event.stop(evt);
+            return false;
+        },
+        _onDiscard: function(evt) {
+        },
+        _onShowPreview: function() {
+            Controller.go('/viewSurvey/'+store.getIdentity(this.survey));
+        }
+    });
 });
 
Index: Dev/branches/rest-dojo-ui/client/rft/pages/surveys.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/surveys.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/surveys.html	(revision 407)
@@ -1,6 +1,7 @@
-<div data-dojo-type="rft.pages.surveys">
-	<button data-dojo-type="dijit.form.Button" class="blue" data-dojo-props="disabled: true, baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'" data-rft-attach-point="btnEdit">Edit</button>
-	<button data-dojo-type="dijit.form.Button" class="blue" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconPlus'" data-rft-attach-point="btnNew">New</button>
-	<div data-dojo-type="dojox.grid.DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]"
-	data-rft-attach-point="grid"></div>
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'">
+        <button data-dojo-type="dijit/form/Button" class="blue" data-dojo-props="disabled: true, baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'" data-dojo-attach-point="btnEdit">Edit</button>
+        <button data-dojo-type="dijit/form/Button" class="blue" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconPlus'" data-dojo-attach-point="btnNew">New</button>
+        <div data-dojo-type="dojox/grid/DataGrid" data-dojo-props="autoWidth:true,autoHeight:true,structure:[{name:'Title',field:'title'}]" data-dojo-attach-point="grid"></div>
+    </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js	(revision 407)
@@ -1,36 +1,48 @@
-define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/Deferred','dojo/data/ObjectStore','rft/auth','rft/store','rft/content','rft/ui/_Page'],
-    function(declare,lang,Deferred,ObjectStore,auth,store,content,_Page){
-        return declare('rft.pages.surveys',[_Page],{
-            selectedObject: null,
-            onVisit: function() {
-                this.grid.setStore(
-                    ObjectStore({objectStore: store}),
-                    "_design/default/_view/by_type",{key:'Survey'});
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/_base/Deferred',
+    'dojo/data/ObjectStore',
+    '../auth',
+    '../store',
+    '../app/Controller',
+    '../app/Page',
+    'dojo/text!./surveys.html'
+],function(declare,lang,Deferred,ObjectStore,auth,store,Controller,Page,template){
+    return declare([Page],{
+        templateString: template,
+        selectedObject: null,
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            this.grid.setStore(
+                ObjectStore({objectStore: store}),
+                "_design/default/_view/by_type",{key:'Survey'});
+            
+            this.grid.on('rowclick',lang.hitch(this,function(evt){
+                this.selectedObject = evt.grid.getItem(evt.rowIndex);
+                this.btnEdit.set('disabled',!this.selectedObject);
+            }));
+
+            this.grid.on('rowdblclick',lang.hitch(this,function(evt){
+                var obj = evt.grid.getItem(evt.rowIndex);
+                Controller.go('/survey/'+store.getIdentity(obj));
+            }));
+            
+            this.btnNew.on('click',lang.hitch(this,function(){
+                Deferred.when( store.add({type:'Survey',creator:auth.getUser()}) )
+                .then(function(obj) {
+                    Controller.go('/survey/'+store.getIdentity(obj));
+                });
+            }));
+
+            this.btnEdit.on('click',lang.hitch(this,function(){
+                if ( this.selectedObject ) {
+                    Controller.go('/survey/'+store.getIdentity(this.selectedObject));
+                }
                 
-                this.grid.on('rowclick',lang.hitch(this,function(evt){
-                    this.selectedObject = evt.grid.getItem(evt.rowIndex);
-                    this.btnEdit.set('disabled',!this.selectedObject);
-                }));
-
-                this.grid.on('rowdblclick',lang.hitch(this,function(evt){
-                    var obj = evt.grid.getItem(evt.rowIndex);
-                    content.goTo('/survey',{uid:store.getIdentity(obj)});
-                }));
-                
-                this.btnNew.on('click',lang.hitch(this,function(){
-                    Deferred.when( store.add({type:'Survey',creator:auth.getUser()}) )
-                    .then(function(obj) {
-                        content.goTo('/survey',{uid:store.getIdentity(obj)});
-                    });
-                }));
-
-                this.btnEdit.on('click',lang.hitch(this,function(){
-                    if ( this.selectedObject ) {
-                        content.goTo('/survey',{uid:store.getIdentity(this.selectedObject)});
-                    }
-                    
-                }));
-            }
-        });
+            }));
+        }
+    });
 });
 
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html	(revision 407)
@@ -1,31 +1,29 @@
-<div data-dojo-type="rft.pages.viewSurvey" class="blue">
-    <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="height: 500px;">
+<div class="blue">
 
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
-            <h2>
-                <span class="rftIcon rftIconSurvey"></span>
-                <span class="headerText" data-rft-attach-point="titleNode">Survey</span>
-            </h2>
-        </div>
-        
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" data-rft-attach-point="questionsPane">
-            <form data-dojo-type="dijit.form.Form" data-rft-attach-point="questionsForm"
-                  data-rft-attach-event="onSubmit:_onSubmit"
-                  style="overflow: auto">
-                <div data-rft-attach-point="questionsAnchor"></div>
-            </form>
-        </div>
-        
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
-            <button data-dojo-type="dijit.form.Button"
-                    type="submit"
-                    data-rft-attach-event="onClick:_onSubmit">
-                Submit</button>
-            <button data-dojo-type="dijit.form.Button"
-                    type="button"
-                    data-rft-attach-event="onClick:_onCancel">
-                Cancel</button>
-        </div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText" data-dojo-attach-point="titleNode">Survey</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" data-dojo-attach-point="questionsPane">
+        <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="questionsForm"
+              data-dojo-attach-event="onSubmit:_onSubmit"
+              style="overflow: auto">
+            <div data-dojo-attach-point="questionsAnchor"></div>
+        </form>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
+        <button data-dojo-type="dijit/form/Button"
+                type="submit"
+                data-dojo-attach-event="onClick:_onSubmit">
+            Submit</button>
+        <button data-dojo-type="dijit/form/Button"
+                type="button"
+                data-dojo-attach-event="onClick:_onCancel">
+            Cancel</button>
+    </div>
 
-    </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 407)
@@ -6,46 +6,48 @@
     'dojo/_base/lang',
     '../store',
-    '../ui/_Page',
-    '../ui/content/ContentWidgetFactory'
-    ],
-    function(array,declare,Deferred,event,lang,store,_Page,ContentWidgetFactory){
-        return declare('rft.pages.viewSurvey',[_Page],{
-            survey: null,
-            constructor: function(){
-                this._dataMap = {};
-            },
-            onVisit: function() {
-                if ( this.pageArgs.uid ) {
-                    Deferred.when(store.get(this.pageArgs.uid))
-                    .then(lang.hitch(this,function(obj){
-                        var f = new ContentWidgetFactory();
-                        this.survey = obj;
-                        store.query(null,{keys:this.survey.questions,include_docs:true})
-                        .forEach(function(question){
-                            array.forEach(question.content || [],function(item){
-                                var w = f.createViewWidget(item,{
-                                    name: question.code+'.'+item.code
-                                });
-                                if ( w !== null ) {
-                                    w.placeAt(this.questionsAnchor,'before');
-                                }
-                            },this);
+    '../app/Page',
+    '../ui/content/ContentWidgetFactory',
+    'dojo/text!./viewSurvey.html'
+],function(array,declare,Deferred,event,lang,store,Page,ContentWidgetFactory,template){
+    return declare([Page],{
+        templateString: template,
+        survey: null,
+        constructor: function(){
+            this._dataMap = {};
+        },
+        startup: function() {
+            if ( this._started ) { return; }
+            this.inherited(arguments);
+            if ( this.surveyId ) {
+                Deferred.when(store.get(this.surveyId))
+                .then(lang.hitch(this,function(obj){
+                    var f = new ContentWidgetFactory();
+                    this.survey = obj;
+                    store.query(null,{keys:this.survey.questions,include_docs:true})
+                    .forEach(function(question){
+                        array.forEach(question.content || [],function(item){
+                            var w = f.createViewWidget(item,{
+                                name: question.code+'.'+item.code
+                            });
+                            if ( w !== null ) {
+                                w.placeAt(this.questionsAnchor,'before');
+                            }
                         },this);
-                    }));
-                } else {
-                    throw "No valid uid or survey passed!";
-                }
-            },
-            _onSubmit: function(evt) {
-                var value = this.questionsForm.get('value');
-                this.questionsPane.set('content','<pre>'+JSON.stringify(value)+'</pre>');
-                event.stop(evt);
-                return false;
-            },
-            _onCancel: function(evt) {
-                event.stop(evt);
-                return false;
+                    },this);
+                }));
+            } else {
+                throw "No valid uid or survey passed!";
             }
-        });
+        },
+        _onSubmit: function(evt) {
+            var value = this.questionsForm.get('value');
+            this.questionsPane.set('content','<pre>'+JSON.stringify(value)+'</pre>');
+            event.stop(evt);
+            return false;
+        },
+        _onCancel: function(evt) {
+            event.stop(evt);
+            return false;
+        }
+    });
 });
-
Index: Dev/branches/rest-dojo-ui/client/rft/rft.profile.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/rft.profile.js	(revision 406)
+++ 	(revision )
@@ -1,42 +1,0 @@
-var profile = {
-    basePath: '..',
-    action: 'release',
-    cssOptimize: 'comments',
-    mini: true,
-    optimize: 'closure',
-    layerOptimize: 'closure',
-    stripConsole: 'all',
-    selectorEngine: 'acme',
-    layers: {
-        'dojo/dojo': {
-            include: [ 'dojo/dojo', 'dojo/domReady', 'rft/main' ],
-            boot: true,
-            customBase: true
-        },
-    },
-
-    staticHasFeatures: {
-        'dojo-trace-api':0,
-        'dojo-log-api':0,
-        'dojo-publish-privates':0,
-        'dojo-sync-loader':0,
-        'dojo-test-sniff':0
-    },
-
-    resourceTags: {
-        test: function (filename, mid) {
-            return false;
-        },
-        copyOnly: function (filename, mid) {
-            return false;
-        },
-        amd: function (filename, mid) {
-            return /\.js$/.test(filename);
-        },
-        miniExclude: function (filename, mid) {
-            return mid in {
-                'rft/profile': 1
-            };
-        }
-    }
-};
Index: Dev/branches/rest-dojo-ui/client/rft/routes.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/routes.js	(revision 407)
+++ Dev/branches/rest-dojo-ui/client/rft/routes.js	(revision 407)
@@ -0,0 +1,24 @@
+define([
+    './pages/index',
+    './pages/questions',
+    './pages/question',
+    './pages/surveys',
+    './pages/survey',
+    './pages/sessions',
+    './pages/session',
+    './pages/viewSurvey'
+],function(index,questions,question,surveys,survey,sessions,session,viewSurvey){
+
+    return [
+        { path: "/", redirect: "/index" },
+        { path: "/index", constructor: index },
+        { path: "/questions", constructor: questions },
+        { path: "/question/:questionId", constructor: question },
+        { path: "/surveys", constructor: surveys },
+        { path: "/survey/:surveyId", constructor: survey },
+        { path: "/sessions", constructor: sessions },
+        { path: "/session/:sessionId", constructor: session },
+        { path: "/viewSurvey/:surveyId", constructor: viewSurvey }
+    ];
+
+});
Index: Dev/branches/rest-dojo-ui/client/rft/run.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/run.js	(revision 407)
@@ -1,30 +1,14 @@
 require([
-    'dojo/_base/connect',
-    'dojo/_base/window',
-    'dojo/dom',
+    'dojo/_base/array',
     'dojo/parser',
-    'rft/auth',
-    'rft/content',
-    'rft/ui/LoginDialog',
-    'rft/indexContent',
+    'rft/app/Controller',
+    'rft/routes',
     'rft/stddeps',
     'dojo/domReady!'
-],function(connect,win,dom,parser,auth,content,LoginDialog) {
+],function(array,parser,controller,routes) {
     parser.parse();
-    content.init();
-
-    var login = new LoginDialog().placeAt(win.body());
-    login.startup();
-
-    auth.restore()
-    .then(function(){
-        content.initial();
-    },function(){
-        login.show();
+    array.forEach(routes,function(route){
+        controller.register(route);
     });
-
-    connect.connect(dom.byId('loginMenu'),'click',function(){
-        login.show();
-    });
-
+    controller.startup();
 });
Index: Dev/branches/rest-dojo-ui/client/rft/stddeps.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/stddeps.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/stddeps.js	(revision 407)
@@ -1,4 +1,4 @@
 define([
-    // dijit & rft widgets used declaratively in templates and pages
+    // dijit & rft widgets used declaratively in templates
     'dijit/Dialog',
     'dijit/DropDownMenu',
@@ -35,14 +35,4 @@
     'rft/ui/lists/AccountListView',
     'rft/ui/lists/List',
-    'rft/ui/lists/OrderedList',
-
-    // pages -> load dynamically?
-    'rft/pages/index',
-    'rft/pages/questions',
-    'rft/pages/question',
-    'rft/pages/session',
-    'rft/pages/sessions',
-    'rft/pages/surveys',
-    'rft/pages/survey',
-    'rft/pages/viewSurvey'
+    'rft/ui/lists/OrderedList'
 ],function(){});
Index: Dev/branches/rest-dojo-ui/client/rft/store.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 407)
@@ -10,5 +10,5 @@
     
     var CouchStore = declare(null, {
-        /** dojo.Store implementation for CouchDB
+        /** dojo Store implementation for CouchDB
          *
          * See for details on the REST API, the wiki
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/Breadcrumbs.js	(revision 407)
@@ -5,7 +5,8 @@
     'dojo/dom-class',
     'dojo/topic',
-    'dijit/_WidgetBase'
-], function(declare, baseArray, Button, domClass, topic, _WidgetBase){
-    return declare('rft.ui.Breadcrumbs', [_WidgetBase], {
+    'dijit/_WidgetBase',
+    '../app/Controller'
+], function(declare, baseArray, Button, domClass, topic, _WidgetBase,Controller){
+    return declare([_WidgetBase], {
         _crumbs: [],
         
@@ -14,6 +15,6 @@
         },
         _getIndexOf: function(label) {
-            dojo.forEach(this._crumbs, function(crumb, index){
-                if (crumb.label == label) {
+            baseArray.forEach(this._crumbs, function(crumb, index){
+                if (crumb.label === label) {
                     return index;
                 }
@@ -31,5 +32,5 @@
             var removals = this._crumbs.slice(index+1);
             this._crumbs = this._crumbs.slice(0, index+1);
-            dojo.forEach(removals, function(removal){
+            baseArray.forEach(removals, function(removal){
                 removal.widget.destroyRecursive(false); // boolean "keepDOMnode"
             }, this);
@@ -60,10 +61,10 @@
                 iconClass: "dijitNoIcon",
                 onClick: lang.hitch(this, function(){
-                    rft.api.loadPage(path);  // TODO: fix this call!
+                    Controller.go(path);  // TODO: fix this call!
                 })
             });
         },
         _createBreadcrumbs: function() {
-            dojo.forEach(this._crumbs, function(crumb, index){
+            baseArray.forEach(this._crumbs, function(crumb, index){
                 if (!crumb.widget) {
                     crumb.widget = this._createBreadcrumb(crumb.label, crumb.path);
Index: Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 407)
@@ -11,5 +11,5 @@
     'dojo/text!./templates/LineWithActionsWidget.html'
 ],function(declare,lang,on,dom,event,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
-    return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
         templateString: templateString,
         baseClass: 'rftLineWithButtons',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MainMenu.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MainMenu.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/MainMenu.js	(revision 407)
@@ -2,5 +2,5 @@
     'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dojo/text!./templates/MainMenu.html'],
     function(declare,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,template){
-        return declare('rft.ui.MainMenu',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
             templateString: template
         });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MenuBarLink.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MenuBarLink.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/MenuBarLink.js	(revision 407)
@@ -1,10 +1,10 @@
-define(['dojo/_base/declare','dijit/MenuBarItem','../content'],
-function(declare,MenuBarItem,content){
-    return declare('rft.ui.MenuBarLink',[MenuBarItem],{
+define(['dojo/_base/declare','dijit/MenuBarItem','../app/Controller'],
+function(declare,MenuBarItem,Controller){
+    return declare([MenuBarItem],{
         options:{
-            pageId: null
+            path: null
         },
         onClick: function(){
-            content.goTo(this.pageId);
+            this.path && Controller.go(this.path);
         }
     });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/MenuLink.js	(revision 407)
@@ -1,10 +1,10 @@
-define(['dojo/_base/declare','dijit/MenuItem','../content'],
-function(declare,MenuItem,content){
-    return declare('rft.ui.MenuLink',[MenuItem],{
+define(['dojo/_base/declare','dijit/MenuItem','../app/Controller'],
+function(declare,MenuItem,Controller){
+    return declare([MenuItem],{
         options:{
-            pageId: null
+            path: null
         },
         onClick: function(){
-            content.goTo(this.pageId);
+            this.path && Controller.go(this.path);
         }
     });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MultipleChoiceWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MultipleChoiceWidget.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/MultipleChoiceWidget.js	(revision 407)
@@ -7,5 +7,5 @@
         _WidgetsInTemplateMixin,_Container,
         templateString,RadioButton,CheckBox,TextBox,Button){
-        return declare('rft.ui.MultipleChoiceWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
             templateString: templateString,
             multiple: true,
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Notifications.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Notifications.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/Notifications.js	(revision 407)
@@ -1,5 +1,5 @@
 define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/connect','dojox/widget/Toaster'],
     function(declare,lang,connect,Toaster){
-        return declare('rft.ui.Notifications',[Toaster],{
+        return declare([Toaster],{
             positionDirection: "br-up",
             duration: 1000,
Index: Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js	(revision 407)
@@ -6,7 +6,7 @@
     'dijit/_WidgetsInTemplateMixin',
     'rft/ui/LineWithActionsWidget',
-    'dojo/text!./templates/ObjectBox.html',
+    'dojo/text!./templates/ObjectBox.html'
 ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
-    return declare('rft.ui.ObjectBox', [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
         baseClass: "rftObjectBox",
         templateString: template,
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 407)
@@ -5,30 +5,30 @@
     'dijit/registry',
     './QuestionEditorPreviewItem',
-    './lists/OrderedList',
-    ], function(declare, lang, domConstruct, registry, QuestionEditorPreviewItem, OrderedList) {
-        return declare("rft.ui.QuestionEditorPreview", [OrderedList], {
-            baseClass: 'surveyEditorPreview',
-            type: 'questionContent',
-            withHandles: true,
+    './lists/OrderedList'
+], function(declare, lang, domConstruct, registry, QuestionEditorPreviewItem, OrderedList) {
+    return declare([OrderedList], {
+        baseClass: 'surveyEditorPreview',
+        type: 'questionContent',
+        withHandles: true,
 
-            _createAvatarNode: function(item) {
-                return domConstruct.create("span",{
-                    innerHTML: item.type || "Dragging!!!"
-                });
-            },
-            _createListNode: function(item) {
-                var previewItem = new QuestionEditorPreviewItem({
-                    item: item
-                });
-                previewItem.on('close',lang.hitch(this,'removeItem',item));
-                previewItem.startup();
-                return previewItem.domNode;
-            },
-            getItems: function() {
-                return this.source.getAllNodes()
-                .map(function(node){
-                    return registry.byNode(node).get('value');
-                },this);
-            }
-        });
+        _createAvatarNode: function(item) {
+            return domConstruct.create("span",{
+                innerHTML: item.type || "Dragging!!!"
+            });
+        },
+        _createListNode: function(item) {
+            var previewItem = new QuestionEditorPreviewItem({
+                item: item
+            });
+            previewItem.on('close',lang.hitch(this,'removeItem',item));
+            previewItem.startup();
+            return previewItem.domNode;
+        },
+        getItems: function() {
+            return this.source.getAllNodes()
+            .map(function(node){
+                return registry.byNode(node).get('value');
+            },this);
+        }
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 407)
@@ -4,4 +4,5 @@
     'dojo/_base/lang',
     'dojo/dom-class',
+    'dojo/dom-geometry',
     'dojo/on',
     'dijit/_Container',
@@ -10,116 +11,129 @@
     'dijit/_WidgetsInTemplateMixin',
     './content/ContentWidgetFactory',
-    'dojo/text!./templates/QuestionEditorPreviewItem.html',
-    ], function(declare, fx, lang, domClass, on, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, ContentWidgetFactory, template) {
-        return declare("rft.ui.QuestionEditorPreviewItem", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
-            version: "full",
-            templateString: template,
-            baseClass: "surveyEditorPreviewItem",
-            previousContentHeight: 200,
-            item: null,
-            innerWidget: null,
-            foldDuration: [250, 250],
-            animation: null,
-            _editing: false,
+    'dojo/text!./templates/QuestionEditorPreviewItem.html'
+], function(
+    declare,
+    fx,
+    lang,
+    domClass,
+    domGeom,
+    on,
+    _Container,
+    _TemplatedMixin,
+    _WidgetBase,
+    _WidgetsInTemplateMixin,
+    ContentWidgetFactory,
+    template
+){
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+        version: "full",
+        templateString: template,
+        baseClass: "surveyEditorPreviewItem",
+        previousContentHeight: 200,
+        item: null,
+        innerWidget: null,
+        foldDuration: [250, 250],
+        animation: null,
+        _editing: false,
 
-            startup: function() {
-                if ( this._started ){ return; }
-                this.inherited(arguments);
-                this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
-                this.removeButtonNode.onClick = lang.hitch(this, "onClose");
-                this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
-                if (this.item) {
-                    this._showViewWidget();
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
+            this.removeButtonNode.onClick = lang.hitch(this, "onClose");
+            this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
+            if (this.item) {
+                this._showViewWidget();
+            } else {
+                throw "No data supplied to create an innerWidget!";
+            }
+        },
+        _destroyInnerWidget: function() {
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.destroyRecursive();
+            }
+        },
+        _showViewWidget: function() {
+            var factory = new ContentWidgetFactory();
+            this.innerWidget = factory.createViewWidget( this.item );
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.placeAt(this.containerNode);
+                this.innerWidget.startup();
+                this.innerWidget.set('readOnly',true);
+            }
+            this.titleNode.innerHTML = (this.item.code||"(no code)")+" : "+this.item.type+" [preview]";
+        },
+        _showEditWidget: function() {
+            var factory = new ContentWidgetFactory();
+            this.innerWidget = factory.createEditWidget( this.item );
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.placeAt(this.containerNode);
+                this.innerWidget.startup();
+            }
+            this.titleNode.innerHTML = (this.item.code||"(no code)")+" : "+this.item.type+" [editing]";
+        },
+        onClose: function() {},
+        _getValueAttr: function(value) {
+            return this.item;
+        },
+        _setValueAttr: function(value) {
+            this.item = value;
+            this._destroyInnerWidget();
+            if ( this._editing ) {
+                this._showEditWidget();
+            } else {
+                this._showViewWidget();
+            }
+        },
+        toggleEdit: function() {
+            if(this._editing) {
+                if ( this.innerWidget !== null ) {
+                    this.item = this.innerWidget.get('value');
+                }
+                this._destroyInnerWidget();
+                this._showViewWidget();
+                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
+                this.editButtonNode.set("label", "Edit");
+            } else {
+                this._destroyInnerWidget();
+                this._showEditWidget();
+                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
+                this.editButtonNode.set("label", "Done");
+            }
+            this._editing = !this._editing;
+        },
+        toggleFold: function() {
+            if (!this.animation) {
+                if (!domClass.contains(this.domNode, "fold")) {
+                    this.previousContentHeight = domGeom.getMarginBox(this.innerNode).h;
+                    this.animation = fx.animateProperty({
+                        node: this.innerNode,
+                        duration: this.foldDuration[0],
+                        properties: {
+                            height: 1                        
+                        },
+                        onEnd: lang.hitch(this, function(){
+                            domClass.add(this.domNode, "fold");
+                            this.animation = null;
+                        })
+                    }).play();
+                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
                 } else {
-                    throw "No data supplied to create an innerWidget!";
-                }
-            },
-            _destroyInnerWidget: function() {
-                if ( this.innerWidget !== null ) {
-                    this.innerWidget.destroyRecursive();
-                }
-            },
-            _showViewWidget: function() {
-                var factory = new ContentWidgetFactory();
-                this.innerWidget = factory.createViewWidget( this.item );
-                if ( this.innerWidget !== null ) {
-                    this.innerWidget.placeAt(this.containerNode);
-                    this.innerWidget.startup();
-                    this.innerWidget.set('readOnly',true);
-                }
-                this.titleNode.innerHTML = (this.item.code||"(no node)")+" : "+this.item.type+" [preview]";
-            },
-            _showEditWidget: function() {
-                var factory = new ContentWidgetFactory();
-                this.innerWidget = factory.createEditWidget( this.item );
-                if ( this.innerWidget !== null ) {
-                    this.innerWidget.placeAt(this.containerNode);
-                    this.innerWidget.startup();
-                }
-                this.titleNode.innerHTML = (this.item.code||"(no node)")+" : "+this.item.type+" [editing]";
-            },
-            onClose: function() {},
-            _getValueAttr: function(value) {
-                return this.item;
-            },
-            _setValueAttr: function(value) {
-                this.item = value;
-                this._destroyInnerWidget();
-                if ( this._editing ) {
-                    this._showEditWidget();
-                } else {
-                    this._showViewWidget();
-                }
-            },
-            toggleEdit: function() {
-                if(this._editing) {
-                    if ( this.innerWidget !== null ) {
-                        this.item = this.innerWidget.get('value');
-                    }
-                    this._destroyInnerWidget();
-                    this._showViewWidget();
-                    this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
-                    this.editButtonNode.set("label", "Edit");
-                } else {
-                    this._destroyInnerWidget();
-                    this._showEditWidget();
-                    this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
-                    this.editButtonNode.set("label", "Done");
-                }
-                this._editing = !this._editing;
-            },
-            toggleFold: function() {
-                if (!this.animation) {
-                    if (!domClass.contains(this.domNode, "fold")) {
-                        this.previousContentHeight = dojo.marginBox(this.innerNode).h;
-                        this.animation = fx.animateProperty({
-                            node: this.innerNode,
-                            duration: this.foldDuration[0],
-                            properties: {
-                                height: 1                        
-                            },
-                            onEnd: lang.hitch(this, function(){
-                                domClass.add(this.domNode, "fold");
-                                this.animation = null;
-                            })
-                        }).play();
-                        this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
-                    } else {
-                        this.animation = fx.animateProperty({
-                            node: this.innerNode,
-                            duration: this.foldDuration[1],
-                            properties: {
-                                height: this.previousContentHeight                
-                            },
-                            onEnd: lang.hitch(this, function(){
-                                domClass.remove(this.domNode, "fold");
-                                this.animation = null;
-                            })
-                        }).play();
-                        this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
-                    }
+                    this.animation = fx.animateProperty({
+                        node: this.innerNode,
+                        duration: this.foldDuration[1],
+                        properties: {
+                            height: this.previousContentHeight                
+                        },
+                        onEnd: lang.hitch(this, function(){
+                            domClass.remove(this.domNode, "fold");
+                            this.animation = null;
+                        })
+                    }).play();
+                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
                 }
             }
+        }
 
-        });
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 407)
@@ -15,5 +15,5 @@
     'dojo/text!./templates/QuestionEditorToolkit.html'
     ], function(declare, lang, Source, domConstruct, Memory, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, store, CategoryListView, template) {
-        return declare("rft.ui.QuestionEditorToolkit", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+        return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
 
             templateString: template,
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js	(revision 407)
@@ -4,5 +4,5 @@
     'dijit/form/Textarea','./MultipleChoiceWidget'],
     function(declare,lang,domConstruct,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString,TextBox,Textarea,MultipleChoiceWidget){
-        return declare('rft.ui.QuestionWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
             templateString: templateString,
             mode: 'view', // view || edit
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js	(revision 407)
@@ -1,32 +1,34 @@
 define([
+    'dojo/_base/array',
     'dojo/_base/declare',
-    'dojo/_base/array',
+    'dojo/_base/event',
+    'dojo/_base/lang',
+    'dojo/dom-class',
+    'dojo/fx',
+    'dojo/query',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
     'dijit/registry',
-    'dojo/_base/lang',
-    'dojo/_base/event',
-    'dojo/fx',
-    'dijit/_WidgetBase',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetsInTemplateMixin',
-    'dijit/_Container',
     './LineWithActionsWidget',
-    'dojo/text!./templates/Selector.html',
-    'dojo/dom-class',
+    'dojo/text!./templates/Selector.html'
 ],function(
+    baseArray,
     declare,
-    baseArray,
+    event,
+    lang,
+    domClass,
+    fx,
+    query,
+    _Container,
+    _TemplatedMixin,
+    _WidgetBase,
+    _WidgetsInTemplateMixin,
     registry,
-    lang,
-    event,
-    fx,
-    _WidgetBase,
-    _TemplatedMixin,
-    _WidgetsInTemplateMixin,
-    _Container,
     LineWithActionsWidget,
-    templateString,
-    domClass
-    ){
-    return declare('rft.ui.Selector',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+    templateString
+){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
         templateString: templateString,
         baseClass: 'rftSelector',
@@ -125,5 +127,5 @@
         onToggle: function(evt) {
             if (this._folded) {
-                var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
+                var downArrowIcon = query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
                 if (downArrowIcon){
                     domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
@@ -134,5 +136,5 @@
                 this._folded = false;
             } else {
-                var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
+                var upArrowIcon = query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
                 if (upArrowIcon){
                     domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
Index: Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js	(revision 407)
@@ -11,5 +11,5 @@
     ],
     function(declare,lang,win,ContentPane,TabContainer,Standby,store,Selector){
-        return declare('rft.ui.TabbedQuestionBrowser',[TabContainer],{
+        return declare([TabContainer],{
             tabPosition: 'left-h',
 
Index: Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js	(revision 407)
@@ -1,5 +1,5 @@
 require(['dojo/_base/declare','dojo/_base/query','dijit/registry','dojox/widget/TitleGroup'],
     function(declare,query,registry,TitleGroup){
-        return declare('rft.ui.TitleGroup',[TitleGroup],{
+        return declare([TitleGroup],{
             getChildren: function() {
                 return query("> .dijitTitlePane", this.domNode)
Index: Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js	(revision 406)
+++ 	(revision )
@@ -1,51 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/dom-attr',
-    'dojo/parser',
-    'dojo/query',
-    'dijit/layout/ContentPane',
-    'dijit/registry'
-    ],function(declare,lang,attr,parser,query,ContentPane,registry){
-        return declare('rft.ui._Page',[ContentPane],{
-            startup: function() {
-                if ( this._started ){ return; }
-                this.inherited(arguments);
-                this._attachPointsAndEvents();
-                this.onVisit();
-            },
-            _attachPointsAndEvents: function() {
-                query('*[data-rft-attach-point]'/*, this.domNode*/).forEach(lang.hitch(this,function(node){
-                    var point = attr.get(node,'data-rft-attach-point');
-                    var widget = registry.byId(attr.get(node,'id'));
-                    this[point] = widget || node;
-                }));
-                query('*[data-rft-attach-event]'/*, this.domNode*/).forEach(lang.hitch(this,function(node){
-                    var event = attr.get(node,'data-rft-attach-event').split(':');
-                    var eventName = event[0];
-                    var eventHandler = event[1];
-                    var widget = registry.byId(attr.get(node,'id'));
-                    if ( widget ) {
-                        this.connect(widget,eventName,lang.hitch(this,eventHandler));
-                    } else {
-                        this.connect(node,eventName,lang.hitch(this,eventHandler));
-                    }
-                }));
-                query('> script[type^="rft/method"]',this.domNode)
-                .orphan().forEach(lang.hitch(this,function(s){
-                    var methodName = s.getAttribute("data-rft-method");
-                    var func = parser._functionFromScript(s);
-                    this[methodName] = func;
-                }));
-            },
-            /** Event fired after startup of all widgets is complete */
-            onVisit: function(){},
-            /** Event fired before leaving the page. Return false to prevent */
-            onLeave: function(){
-                registry.findWidgets(this.domNode).forEach(function(w){
-                    w.destroyRecursive(false);
-                });
-                return true;
-            }
-        });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/content/ContentWidgetFactory.js	(revision 407)
@@ -17,5 +17,5 @@
     './../lists/OrderedList'
 ],function(array, declare, lang, domConstruct, _TemplatedMixin, _WidgetBase, _Container, Button, CheckBox, NumberSpinner, RadioButton, Textarea, TextBox, TableContainer, _EditableListMixin, OrderedList) {
-    var factory = declare('rft.ui.content.ContentWidgetFactory', [], {
+    var factory = declare(null, {
         createViewWidget: function(/*Object*/options) {
             // options: Object
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/AccountListView.js	(revision 407)
@@ -12,5 +12,5 @@
     OrderedList
 ) {
-    return declare('rft.ui.lists.AccountListView',[OrderedList],{
+    return declare([OrderedList],{
         baseClass: 'rftAccountListView',
         type: 'account',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/CategoryListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/CategoryListView.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/CategoryListView.js	(revision 407)
@@ -3,41 +3,41 @@
     'dojo/_base/lang',
     '../LineWithActionsWidget',
-    './List',
-    ],function(
-        declare,
-        lang,
-        LineWithActionsWidget,
-        List
-        ) {
-        return declare('rft.ui.lists.CategoryListView',[List],{
-            baseClass: 'rftLineListView',
+    './List'
+],function(
+    declare,
+    lang,
+    LineWithActionsWidget,
+    List
+) {
+    return declare([List],{
+        baseClass: 'rftLineListView',
 
-            _createAvatarNode: function(item) {
-                var node = document.createElement("div");
-                node.className = "dragAvatar";
-                node.innerHTML = item.title;
-                return node;
-            },
+        _createAvatarNode: function(item) {
+            var node = document.createElement("div");
+            node.className = "dragAvatar";
+            node.innerHTML = item.title;
+            return node;
+        },
 
-            _createListNode: function(item) {
-                var w = new LineWithActionsWidget({
-                    title: item,
-                    'class': "orange",
-                    actions: {
-                        "Remove" : {
-                            callback: lang.hitch(this, function() {
-                                this.removeItem(item, w);
-                            }),
-                            properties: {
-                                blockButton: false,
-                                icon: "Delete"
-                            }
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item,
+                'class': "orange",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, function() {
+                            this.removeItem(item, w);
+                        }),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
                         }
                     }
-                });
-                w.startup();
-                return w.domNode;
-            }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
 
-        });
     });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/List.js	(revision 407)
@@ -19,5 +19,5 @@
     BorderContainer,
     templateString){
-    return declare('rft.ui.lists.List',[BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{
+    return declare([BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{
         templateString: templateString,
         baseClass: 'rftList',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/MultipleChoiceListView.js	(revision 407)
@@ -12,5 +12,5 @@
     OrderedList
     ) {
-    return declare('rft.ui.lists.MultipleChoiceListView',[OrderedList],{
+    return declare([OrderedList],{
         baseClass: 'rftMultipleChoiceListView',
         type: 'multipleChoiceOption',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/OrderedList.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/OrderedList.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/OrderedList.js	(revision 407)
@@ -12,5 +12,5 @@
         templateString
         ){
-        return declare('rft.ui.lists.OrderedList',[List],{
+        return declare([List],{
             templateString: templateString,
             baseClass: 'rftLineListView',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/QuestionListView.js	(revision 407)
@@ -12,5 +12,5 @@
     OrderedList
 ){
-    return declare('rft.ui.lists.QuestionListView',[OrderedList],{
+    return declare([OrderedList],{
         baseClass: 'rftSurveyListView',
         type: 'question',
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/_EditableListMixin.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/_EditableListMixin.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/_EditableListMixin.js	(revision 407)
@@ -4,5 +4,5 @@
     'dijit/registry'
 ],function(declare,lang,registry){
-    return declare('rft.ui.lists._EditableListMixin',null,{
+    return declare(null,{
         getItems: function() {
             return this.source.getAllNodes()
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/List.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/List.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/List.html	(revision 407)
@@ -1,7 +1,7 @@
 <div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'top'">
 	        <h3 data-dojo-attach-point="titleNode"></h3>
         </div>
-        <div data-dojo-type="dijit.layout.ContentPane"
+        <div data-dojo-type="dijit/layout/ContentPane"
              data-dojo-props="region: 'center'"
              data-dojo-attach-point="sourceNode"
Index: Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/OrderedList.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/OrderedList.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/lists/templates/OrderedList.html	(revision 407)
@@ -1,12 +1,12 @@
 <div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'top'">
 	        <h3 data-dojo-attach-point="titleNode"></h3>
         </div>
-        <div data-dojo-type="dijit.layout.ContentPane"
+        <div data-dojo-type="dijit/layout/ContentPane"
              data-dojo-props="region: 'center'"
              data-dojo-attach-point="sourceNode"
              class="${baseClass}Content">
         </div>
-        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'bottom'" data-dojo-attach-point="buttonsNode">
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" data-dojo-attach-point="buttonsNode">
 		    <span>Move selected: </span>
 		    <button data-dojo-attach-point="btnListMoveUp" ></button>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/LoginDialog.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/LoginDialog.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/LoginDialog.html	(revision 407)
@@ -7,14 +7,14 @@
     </div>
     <div data-dojo-attach-point="containerNode">
-        <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="loginForm">
+        <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="loginForm">
             <fieldset>
                 <label for="email" class="loginLabel">Email</label>
-                <input data-dojo-type="dijit.form.TextBox" name="email" type="text" class="loginInput" />
+                <input data-dojo-type="dijit/form/TextBox" name="email" type="text" class="loginInput" />
                 <label for="password" class="loginLabel">Password</label>
-                <input data-dojo-type="dijit.form.TextBox" name="password" type="password" class="loginInput" />
+                <input data-dojo-type="dijit/form/TextBox" name="password" type="password" class="loginInput" />
             </fieldset>
             <div style="float: right;">
-                <button type="button" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onRegister">Register</button>
-                <button type="submit" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onLogin">Login</button>
+                <button type="button" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onRegister">Register</button>
+                <button type="submit" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onLogin">Login</button>
             </div>
         </form>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/MainMenu.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/MainMenu.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/MainMenu.html	(revision 407)
@@ -1,16 +1,16 @@
 <div class="mainMenu">
-    <div  data-dojo-type="dijit.MenuBar">
-        <div class="rftMainMenuButton" data-dojo-type="rft.ui.MenuBarLink" data-dojo-props="pageId:'sessions'">Sessions</div>
-        <div class="rftMainMenuButton" data-dojo-type="dijit.PopupMenuBarItem">
+    <div  data-dojo-type="dijit/MenuBar">
+        <div class="rftMainMenuButton" data-dojo-type="rft/ui/MenuBarLink" data-dojo-props="path:'/sessions'">Sessions</div>
+        <div class="rftMainMenuButton" data-dojo-type="dijit/PopupMenuBarItem">
             <span>Content</span>
-            <div data-dojo-type="dijit.DropDownMenu">
-                <div data-dojo-type="rft.ui.MenuLink" class="blue bgColorHover" data-dojo-props="pageId:'surveys', iconClass:'rftIcon rftIconSurvey'">Surveys</div>
-                <div data-dojo-type="rft.ui.MenuLink" class="orange bgColorHover" data-dojo-props="pageId:'questions', iconClass:'rftIcon rftIconQuestion'">Questions</div>
-                <div data-dojo-type="rft.ui.MenuLink" class="purple bgColorHover" data-dojo-props="pageId:'applications', iconClass: 'rftIcon rftIconApplication'">Applications</div>
-                <div data-dojo-type="rft.ui.MenuLink" class="red bgColorHover" data-dojo-props="pageId:'dashboards', iconClass: 'rftIcon rftIconDashboard'">Dashboards</div>
+            <div data-dojo-type="dijit/DropDownMenu">
+                <div data-dojo-type="rft/ui/MenuLink" class="blue bgColorHover" data-dojo-props="path:'/surveys', iconClass:'rftIcon rftIconSurvey'">Surveys</div>
+                <div data-dojo-type="rft/ui/MenuLink" class="orange bgColorHover" data-dojo-props="path:'/questions', iconClass:'rftIcon rftIconQuestion'">Questions</div>
+                <div data-dojo-type="rft/ui/MenuLink" class="purple bgColorHover" data-dojo-props="path:'/applications', iconClass: 'rftIcon rftIconApplication'">Applications</div>
+                <div data-dojo-type="rft/ui/MenuLink" class="red bgColorHover" data-dojo-props="path:'/dashboards', iconClass: 'rftIcon rftIconDashboard'">Dashboards</div>
             </div>
         </div>
-        <div class="rftMainMenuButton" data-dojo-type="rft.ui.MenuBarLink" data-dojo-props="pageId:'results'">Results</div>
-        <div class="rftMainMenuButton" data-dojo-type="rft.ui.MenuBarLink" id="loginMenu">Logout</div>
+        <div class="rftMainMenuButton" data-dojo-type="rft/ui/MenuBarLink" data-dojo-props="path:'/results'">Results</div>
+        <div class="rftMainMenuButton" data-dojo-type="rft/ui/MenuBarLink" id="loginMenu">Logout</div>
     </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/MultipleChoiceWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/MultipleChoiceWidget.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/MultipleChoiceWidget.html	(revision 407)
@@ -3,5 +3,5 @@
     </div>
     <div data-dojo-attach-point="buttons" class="row">
-        <div><span class="rowBox"/><span class="rowText"/><span class="rowBtn"/><button data-dojo-type="dijit.form.Button" type="button" data-dojo-attach-event="onClick:_onAddRow" class="rowBtn">+</button></div>
+        <div><span class="rowBox"/><span class="rowText"/><span class="rowBtn"/><button data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-event="onClick:_onAddRow" class="rowBtn">+</button></div>
     </div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html	(revision 407)
@@ -3,7 +3,7 @@
 		<span class="title" data-dojo-attach-point="titleNode">Default title</span>
 		<span class="floatRight" data-dojo-attach-point="buttonsNode">
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit.form.Button" data-dojo-attach-point="editButtonNode" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit.form.Button" data-dojo-attach-point="foldButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconHalfArrowUp'">Fold</button>
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit.form.Button" data-dojo-attach-point="removeButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="editButtonNode" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="foldButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconHalfArrowUp'">Fold</button>
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="removeButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
 		</span>
 	</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html	(revision 407)
@@ -1,21 +1,21 @@
 <div>
-	<div data-dojo-type="dojox.widget.TitleGroup">
-		<div data-dojo-type="dijit.TitlePane" class="orange" data-dojo-props="open:true" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'">
-            <div data-dojo-type="dijit.form.Form" data-dojo-attach-point="propertiesForm">
+	<div data-dojo-type="dojox/widget/TitleGroup">
+		<div data-dojo-type="dijit/TitlePane" class="orange" data-dojo-props="open:true" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'">
+            <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm">
 				<fieldset class="align">
-					<label>Title:</label><input data-dojo-type="dijit.form.TextBox" name="title"/>
-					<label>Code:</label><input data-dojo-type="dijit.form.TextBox" name= "code"/>
+					<label>Title:</label><input data-dojo-type="dijit/form/TextBox" name="title"/>
+					<label>Code:</label><input data-dojo-type="dijit/form/TextBox" name= "code"/>
 					<label>Categories:</label>
 					<div data-dojo-attach-point="listNode" class="rftLineListView"></div> 
 					<div data-dojo-attach-point="categoriesBoxNode"></div>
-					<button class="inheritBgColor" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br>
+					<button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br>
 					<label>Topic:</label>
 					<div data-dojo-attach-point="topicBoxNode"></div>
-					<label>Description:</label><textarea data-dojo-type="dijit.form.Textarea" name="description"></textarea>
+					<label>Description:</label><textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea>
 				</fieldset>
 			</div>
 		</div>
 
-		<div data-dojo-type="dijit.TitlePane" title="Content" data-dojo-props="iconClass:'rftIcon rftIconPlus', open:false">
+		<div data-dojo-type="dijit/TitlePane" title="Content" data-dojo-props="iconClass:'rftIcon rftIconPlus', open:false">
 			<div data-dojo-attach-point="ToolkitContentSourceNode">
 				
@@ -23,5 +23,5 @@
 		</div>
 
-		<div data-dojo-type="dijit.TitlePane" title="Inputs" data-dojo-props="iconClass:'rftIcon rftIconInput', open:false">
+		<div data-dojo-type="dijit/TitlePane" title="Inputs" data-dojo-props="iconClass:'rftIcon rftIconInput', open:false">
 			<div data-dojo-attach-point="ToolkitInputsSourceNode">
 				
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html	(revision 407)
@@ -1,16 +1,16 @@
 <div>
-    <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="ourForm">
+    <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="ourForm">
         <fieldset>
             <label for="code" class="loginLabel">Code</label>
-            <input data-dojo-type="dijit.form.TextBox" name="code" type="text" class="loginInput" />
+            <input data-dojo-type="dijit/form/TextBox" name="code" type="text" class="loginInput" />
             <label for="question" class="loginLabel">Title</label>
-            <input data-dojo-type="dijit.form.TextBox" name="title" type="text" class="loginInput" />
+            <input data-dojo-type="dijit/form/TextBox" name="title" type="text" class="loginInput" />
             <label for="question" class="loginLabel">Description</label>
-            <input data-dojo-type="dijit.form.Textarea" name="description" type="text" class="loginInput"/>
+            <input data-dojo-type="dijit/form/Textarea" name="description" type="text" class="loginInput"/>
             <label for="category" class="loginLabel">Category</label>
-            <input data-dojo-type="dijit.form.TextBox" name="category" type="text" class="loginInput" />
+            <input data-dojo-type="dijit/form/TextBox" name="category" type="text" class="loginInput" />
         </fieldset>
         <fieldset>
-            <select data-dojo-type="dijit.form.Select" data-dojo-attach-point="scaleSelector" data-dojo-attach-event="onChange:_onTypeChange" name="scale">
+            <select data-dojo-type="dijit/form/Select" data-dojo-attach-point="scaleSelector" data-dojo-attach-event="onChange:_onTypeChange" name="scale">
                 <option value="string" selected>String</option>
                 <option value="text">Text</option>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html	(revision 407)
@@ -1,5 +1,5 @@
 <div class="${baseClass}">
     <span class="rftIcon rftIconSession" data-dojo-attach-point="iconNode"></span>
-    <div data-dojo-type="rft.ui.LineWithActionsWidget" data-dojo-attach-point="upperNode" data-dojo-props="actions: {'inspect':{callback: inspect, properties: {blockButton: true}}}"></div>
-    <div data-dojo-type="rft.ui.LineWithActionsWidget" data-dojo-attach-point="lowerNode"></div>
+    <div data-dojo-type="rft/ui/LineWithActionsWidget" data-dojo-attach-point="upperNode" data-dojo-props="actions: {'inspect':{callback: inspect, properties: {blockButton: true}}}"></div>
+    <div data-dojo-type="rft/ui/LineWithActionsWidget" data-dojo-attach-point="lowerNode"></div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/view.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/view.js	(revision 406)
+++ Dev/branches/rest-dojo-ui/client/rft/view.js	(revision 407)
@@ -1,18 +1,11 @@
 require([
     'dojo/parser',
-    'rft/auth',
-    'rft/content',
     'rft/stddeps',
-    'rft/viewContent',
     'dojo/domReady!'
-],function(parser,auth,content) {
+],function(parser) {
     parser.parse();
-    content.init();
-
-    auth.restore()
-    .then(function(){
-        content.initial();
-    },function(){
-    });
-
+    // read options from hash/url
+    // authenticate
+    // set content
+    // go for it
 });
Index: Dev/branches/rest-dojo-ui/client/rft/viewContent.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/viewContent.js	(revision 406)
+++ 	(revision )
@@ -1,20 +1,0 @@
-define([
-    'dojo/hash',
-    'dojo/io-query',
-    './content'
-],function(hash,uriQuery,content){
-    return new (function(){
-
-            content.initialImpl = function(path,args) {
-                args = args || {};
-                if ( hash() ) {
-                    var parts = hash().split('!');
-                    if ( parts[1] ) {
-                        args = uriQuery.queryToObject(parts[1]);
-                    }
-                }
-                return content._loadPage('/viewSurvey',args);
-            };
-
-    })();
-});
