Index: /Dev/trunk/client/qed/Gruntfile.js
===================================================================
--- /Dev/trunk/client/qed/Gruntfile.js	(revision 426)
+++ /Dev/trunk/client/qed/Gruntfile.js	(revision 426)
@@ -0,0 +1,55 @@
+var fs = require('fs');
+var path = require('path');
+
+module.exports = function(grunt) {
+
+    grunt.initConfig({
+        pkg: grunt.file.readJSON('package.json'),
+        less: {
+            options: {
+                strictImports: true
+            },
+            all: {
+                files: {
+                    'css/main.css': 'css/main.less'
+                }
+            }
+        },
+        jshint: {
+            options: {
+                /* enforcing options */
+                bitwise: true,
+                curly: true,
+                eqeqeq: true,
+                immed: true,
+                indent: 4,
+                latedef: true,
+                newcap: true,
+                noarg: true,
+                undef: true,
+                unused: false,
+                strict: false,
+                /* relaxing options */
+                loopfunc: true,
+                /* enverinments */
+                devel: true,
+                node: true,
+                /* globals */
+                globals: {
+                    require: true,
+                    define: true
+                }
+            },
+            all: {
+                files: {
+                    src: ['**/*.js', '!node_modules/**']
+                }
+            }
+        }
+    });
+
+    grunt.loadNpmTasks('grunt-contrib-less');
+    grunt.loadNpmTasks('grunt-contrib-jshint');
+
+    grunt.registerTask('default', ['less', 'jshint']);
+};
Index: /Dev/trunk/client/qed/lib/async.js
===================================================================
--- /Dev/trunk/client/qed/lib/async.js	(revision 425)
+++ /Dev/trunk/client/qed/lib/async.js	(revision 426)
@@ -1,7 +1,7 @@
 define([
-     'dojo/_base/array',
-     'dojo/_base/lang',
-     'dojo/when',
-     'dojo/Deferred'
+    'dojo/_base/array',
+    'dojo/_base/lang',
+    'dojo/when',
+    'dojo/Deferred'
 ],function(array,lang,when,Deferred){
 
@@ -20,12 +20,14 @@
         var running = null;
         function cancel(err) {
-            if ( cancelled ) return;
+            if ( cancelled ) { return; }
             cancelled = true;
-            running && running.cancel && !running.isFulfilled() && running.cancel();
+            if ( running && running.cancel && !running.isFulfilled() ) {
+                running.cancel();
+            }
             d.reject(err);
         }
 
         function update(fs,arg) {
-            if ( cancelled ) return;
+            if ( cancelled ) { return; }
             if ( fs.length > 0 ) {
                 try {
@@ -58,21 +60,25 @@
      */
     function par(functions,ctx) {
-        var d = new Deferred(cancel);
-
+        var d; // later: Deferred
+        
         var cancelled = false;
         var running = [];
         function cancel(err) {
-            if (cancelled) return;
+            if (cancelled) { return; }
             cancelled = true;
             array.forEach(running,function(running){
-                running && running.cancel && !running.isFulfilled() && running.cancel();
+                if ( running && running.cancel && !running.isFulfilled() ) {
+                    running.cancel();
+                }
             });
             d.reject(err);
         }
 
+        d = new Deferred(cancel);
+
         var results = [];
         var left = functions.length;
         function update(res,idx) {
-            if (cancelled) return;
+            if (cancelled) { return; }
             results[idx] = res;
             left -= 1; // Works because/as long as AJAX/JS is single-threaded.
@@ -83,5 +89,5 @@
 
         array.forEach(functions,function(f,idx){
-            if (cancelled) return;
+            if (cancelled) { return; }
             try {
                 running.push(when(f.call(ctx)).then(function(res){
Index: /Dev/trunk/client/qed/main-response.js
===================================================================
--- /Dev/trunk/client/qed/main-response.js	(revision 425)
+++ /Dev/trunk/client/qed/main-response.js	(revision 426)
@@ -14,5 +14,5 @@
     'dojo/domReady!',
     'qed/stddeps'
-],function(date,locale,hash,parser,store,Content,Page,Path,async,Response,SurveyRun,response) {
+],function(date,locale,hash,parser,store,Content,Page,Path,async,Response,SurveyRun,ResponsePage) {
     parser.parse();
     Content.startup();
@@ -73,5 +73,5 @@
     .then(function(responseId){
         hash(Path.format("/"+surveyRunId,{ id: responseId }));
-        Content.set(new response({
+        Content.set(new ResponsePage({
             surveyRunId: surveyRunId,
             options: {
Index: /Dev/trunk/client/qed/model/schema.js
===================================================================
--- /Dev/trunk/client/qed/model/schema.js	(revision 425)
+++ /Dev/trunk/client/qed/model/schema.js	(revision 426)
@@ -28,5 +28,5 @@
     var string = mkType({ type:'string' });
     var integer = mkType({ type: 'integer' });
-    var boolean = mkType({ type: 'boolean' });
+    var bool = mkType({ type: 'boolean' });
     var pattern = function(p){
         return mixin({
@@ -102,5 +102,5 @@
             }),
             typedobject('MultipleChoiceInput',{
-                multiple:boolean(),
+                multiple:bool(),
                 items:array(nestring())
             })
Index: /Dev/trunk/client/qed/model/widgets/CategoryListView.js
===================================================================
--- /Dev/trunk/client/qed/model/widgets/CategoryListView.js	(revision 425)
+++ /Dev/trunk/client/qed/model/widgets/CategoryListView.js	(revision 426)
@@ -2,19 +2,16 @@
     'dojo/_base/declare',
     'dojo/_base/lang',
+    'dojo/dom-construct',
     '../../widgets/LineWithActionsWidget',
     '../../widgets/list/List'
-],function(
-    declare,
-    lang,
-    LineWithActionsWidget,
-    List
-) {
+],function(declare, lang, domConstruct, LineWithActionsWidget, List) {
     return declare([List],{
         baseClass: 'rftLineListView',
 
         _createAvatarNode: function(item) {
-            var node = document.createElement("div");
-            node.className = "dragAvatar";
-            node.innerHTML = item.title;
+            var node = domConstruct.create("div",{
+                className: "dragAvatar",
+                innerHTML: item.title
+            });
             return node;
         },
Index: /Dev/trunk/client/qed/model/widgets/QuestionEditorToolkit.js
===================================================================
--- /Dev/trunk/client/qed/model/widgets/QuestionEditorToolkit.js	(revision 425)
+++ /Dev/trunk/client/qed/model/widgets/QuestionEditorToolkit.js	(revision 426)
@@ -14,153 +14,155 @@
     './CategoryListView',
     'dojo/text!./templates/QuestionEditorToolkit.html'
-    ], function(declare, lang, Source, domConstruct, Memory, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, store, CategoryListView, template) {
-        return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+], function(declare, lang, Source, domConstruct, Memory, _Container,
+        _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button,
+        ComboBox, store, CategoryListView, template) {
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
 
-            templateString: template,
-            _list: null,
-            _categorySelect: null,
-            _categoryStore: null,
-            _topicSelect: null,
-            _topicStore: null,
-            _categories : null,
+        templateString: template,
+        _list: null,
+        _categorySelect: null,
+        _categoryStore: null,
+        _topicSelect: null,
+        _topicStore: null,
+        _categories : null,
 
-            _contentItems: [
-                { type: "Header" },
-                { type: "Text" },
-                { type: "Image" },
-                { type: "ExternalMedia" },
-                { type: "Divider" }
-            ],
-            _inputsItems: [
-                { type: "StringInput" },
-                { type: "TextInput" },
-                { type: "IntegerInput" },
-                { type: "ScaleInput" },
-                { type: "MultipleChoiceInput" }
-            ],
-            _labelMap: {
-                "Header": "Header",
-                "Text": "Text",
-                "Image": "Image",
-                "ExternalMedia": "External media",
-                "Divider": "Divider",
-                "StringInput": "Text line",
-                "TextInput": "Free text",
-                "IntegerInput": "Integer number",
-                "ScaleInput": "Scale",
-                "MultipleChoiceInput": "Multiple choice"
-            },
-            _iconMap: {
-                "Header": "Header",
-                "Text": "TextBox",
-                "Image": "Image",
-                "ExternalMedia": "External",
-                "Divider": "Divider",
-                "StringInput": "Text",
-                "TextInput": "Text",
-                "IntegerInput": "Integer",
-                "ScaleInput": "Scale",
-                "MultipleChoiceInput": "MultipleChoice"
-            },
+        _contentItems: [
+            { type: "Header" },
+            { type: "Text" },
+            { type: "Image" },
+            { type: "ExternalMedia" },
+            { type: "Divider" }
+        ],
+        _inputsItems: [
+            { type: "StringInput" },
+            { type: "TextInput" },
+            { type: "IntegerInput" },
+            { type: "ScaleInput" },
+            { type: "MultipleChoiceInput" }
+        ],
+        _labelMap: {
+            "Header": "Header",
+            "Text": "Text",
+            "Image": "Image",
+            "ExternalMedia": "External media",
+            "Divider": "Divider",
+            "StringInput": "Text line",
+            "TextInput": "Free text",
+            "IntegerInput": "Integer number",
+            "ScaleInput": "Scale",
+            "MultipleChoiceInput": "Multiple choice"
+        },
+        _iconMap: {
+            "Header": "Header",
+            "Text": "TextBox",
+            "Image": "Image",
+            "ExternalMedia": "External",
+            "Divider": "Divider",
+            "StringInput": "Text",
+            "TextInput": "Text",
+            "IntegerInput": "Integer",
+            "ScaleInput": "Scale",
+            "MultipleChoiceInput": "MultipleChoice"
+        },
 
-            postCreate: function(){
-                this.inherited(arguments);
-                var creator = lang.hitch(this,"_creator");
-                this.contentSource = new Source(this.ToolkitContentSourceNode, {
-                    accept: [],
-                    copyOnly: true,
-                    selfAccept: false,
-                    singular: true,
-                    creator: creator
+        postCreate: function(){
+            this.inherited(arguments);
+            var creator = lang.hitch(this,"_creator");
+            this.contentSource = new Source(this.ToolkitContentSourceNode, {
+                accept: [],
+                copyOnly: true,
+                selfAccept: false,
+                singular: true,
+                creator: creator
+            });
+            this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
+                accept: [],
+                copyOnly: true,
+                selfAccept: false,
+                singular: true,
+                creator: creator
+            });
+            this.contentSource.insertNodes(false, this._contentItems);
+            this.inputsSource.insertNodes(false, this._inputsItems);
+        },
+        _setValueAttr: function(question) {
+            this.propertiesForm.set('value', question);
+            this._categories = question.categories || [];
+            this._setupListView();
+            this._setupCategories();
+            this._setupTopic(question.topic);
+        },
+        _getValueAttr: function() {
+            var value = this.propertiesForm.get('value');
+            value.categories = this._categories;
+            return value;
+        },
+        onCategoryAdd: function() {
+            this._addCategory(this._categorySelect.get('displayedValue')); 
+            this._categorySelect.reset();
+        },
+        _creator: function(item, hint) {
+            var node;
+            if (hint === "avatar") {
+                node = domConstruct.create('span',{
+                    innerHTML: this._labelMap[item.type] || item.type
                 });
-                this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
-                    accept: [],
-                    copyOnly: true,
-                    selfAccept: false,
-                    singular: true,
-                    creator: creator
+            } else {
+                var w = new Button({
+                    baseClass: "rftLargeButton",
+                    iconClass: "rftIcon rftIcon"+(this._iconMap[item.type]||"Unknown"),
+                    label: this._labelMap[item.type] || item.type,
+                    showLabel: true,
+                    'class': "newline"
                 });
-                this.contentSource.insertNodes(false, this._contentItems);
-                this.inputsSource.insertNodes(false, this._inputsItems);
-            },
-            _setValueAttr: function(question) {
-                this.propertiesForm.set('value', question);
-                this._categories = question.categories || [];
-                this._setupListView();
-                this._setupCategories();
-                this._setupTopic(question.topic);
-            },
-            _getValueAttr: function() {
-                var value = this.propertiesForm.get('value');
-                value.categories = this._categories;
-                return value;
-            },
-            onCategoryAdd: function() {
-                this._addCategory(this._categorySelect.get('displayedValue')); 
-                this._categorySelect.reset();
-            },
-            _creator: function(item, hint) {
-                var node;
-                if (hint == "avatar") {
-                    node = domConstruct.create('span',{
-                        innerHTML: this._labelMap[item.type] || item.type
-                    });
-                } else {
-                    var w = new Button({
-                        baseClass: "rftLargeButton",
-                        iconClass: "rftIcon rftIcon"+(this._iconMap[item.type]||"Unknown"),
-                        label: this._labelMap[item.type] || item.type,
-                        showLabel: true,
-                        'class': "newline"
-                    });
-                    node = w.domNode;
-                }
-                return {node: node, data: item, type: ["questionContent"]};
-            },
-            _setupListView: function() {
-                this._list = new CategoryListView( {
-                    removeCallback: lang.hitch(this, this._removeCategory)
-                }).placeAt(this.listNode);
-                this._list.startup();                
-                for (var category in this._categories) {
-                    this._list.appendItem(this._categories[category]);
-                }    
-            },
-            _setupCategories: function() {
-                this._categoryStore = new Memory({data: [] });
-                store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
-                .forPairs(lang.hitch(this, function(value, key) {
-                    this._categoryStore.put({ id: key[0] });
-                }));
-                this._categorySelect = new ComboBox( {
-                    name: "categories",
-                    store: this._categoryStore,
-                    searchAttr: "id"
-                }, this.categoriesBoxNode);
-                this._supportingWidgets.push(this._categorySelect);
+                node = w.domNode;
+            }
+            return {node: node, data: item, type: ["questionContent"]};
+        },
+        _setupListView: function() {
+            this._list = new CategoryListView( {
+                removeCallback: lang.hitch(this, this._removeCategory)
+            }).placeAt(this.listNode);
+            this._list.startup();                
+            for (var category in this._categories) {
+                this._list.appendItem(this._categories[category]);
+            }    
+        },
+        _setupCategories: function() {
+            this._categoryStore = new Memory({data: [] });
+            store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
+            .forPairs(lang.hitch(this, function(value, key) {
+                this._categoryStore.put({ id: key[0] });
+            }));
+            this._categorySelect = new ComboBox( {
+                name: "categories",
+                store: this._categoryStore,
+                searchAttr: "id"
+            }, this.categoriesBoxNode);
+            this._supportingWidgets.push(this._categorySelect);
 
-            },
-            _setupTopic: function(topic) {
-                this._topicStore = new Memory( {data: [] });
-                store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
-                .forPairs(lang.hitch(this, function(value, key) {
-                    this._topicStore.put({ id: key });
-                }));
-                this._topicSelect = new ComboBox( {
-                    name: "topic",
-                    store: this._topicStore,
-                    searchAttr: "id",
-                    value: topic
-                }, this.topicBoxNode);
-                this._supportingWidgets.push(this._topicSelect);
-            },
-            _addCategory: function(item) {
-                this._categories.push(item);
-                this._list.appendItem(item);
-            },
-            _removeCategory: function(item) {
-                this._categories.splice(this._categories.indexOf(item), 1);
-            }
+        },
+        _setupTopic: function(topic) {
+            this._topicStore = new Memory( {data: [] });
+            store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
+            .forPairs(lang.hitch(this, function(value, key) {
+                this._topicStore.put({ id: key });
+            }));
+            this._topicSelect = new ComboBox( {
+                name: "topic",
+                store: this._topicStore,
+                searchAttr: "id",
+                value: topic
+            }, this.topicBoxNode);
+            this._supportingWidgets.push(this._topicSelect);
+        },
+        _addCategory: function(item) {
+            this._categories.push(item);
+            this._list.appendItem(item);
+        },
+        _removeCategory: function(item) {
+            this._categories.splice(this._categories.indexOf(item), 1);
+        }
 
-        });
     });
+});
Index: /Dev/trunk/client/qed/model/widgets/QuestionListView.js
===================================================================
--- /Dev/trunk/client/qed/model/widgets/QuestionListView.js	(revision 425)
+++ /Dev/trunk/client/qed/model/widgets/QuestionListView.js	(revision 426)
@@ -36,5 +36,7 @@
                     },
                     "Info" : {
-                        callback: function(){ item.description && alert(item.description); },
+                        callback: function(){
+                            if ( item.description ) { alert(item.description); }
+                        },
                         properties: {
                             blockButton: false,
Index: /Dev/trunk/client/qed/model/widgets/QuestionWidget.js
===================================================================
--- /Dev/trunk/client/qed/model/widgets/QuestionWidget.js	(revision 425)
+++ /Dev/trunk/client/qed/model/widgets/QuestionWidget.js	(revision 426)
@@ -2,73 +2,74 @@
     'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin',
     'dojo/text!./templates/QuestionWidget.html','dijit/form/TextBox',
-    'dijit/form/Textarea','../../widgets/MultipleChoiceWidget'],
-    function(declare,lang,domConstruct,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString,TextBox,Textarea,MultipleChoiceWidget){
-        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
-            templateString: templateString,
-            mode: 'view', // view || edit
-            name: '',
-            value: null,
-            _scale: null,
-            _widgetCache: null,
-            constructor: function() {
-                this.inherited(arguments);
-                this.value = {};
-                this._widgetCache = {};
-            },
-            postCreate: function() {
-                this._resetValue = this.value;
-                this.scaleSelector.set('disabled', this.mode == 'edit');
-            },
-            _setValueAttr: function(value) {
-                this.value = value;
-                this._onTypeChange(value.scale || 'string');
-                this.ourForm.set('value',value);
-            },
-            _getValueAttr: function() {
-                var value = this.ourForm.get('value');
-                lang.mixin(this.value,value);
-                return this.value;
-            },
-            _onTypeChange: function(scale) {
-                if ( this._scale == scale ) return;
-                this._scale = scale;
-                domConstruct.empty(this.scaleDetails);
-                var widget = this._getTypeWidget(scale);
-                widget && widget.placeAt(this.scaleDetails,'only');
-            },
-            _getTypeWidget: function(scale) {
-                var widget = this._widgetCache[scale];
-                if (!widget) {
-                    switch(scale) {
-                        case 'string':
-                            widget = new TextBox({
-                                name: 'answers',
-                                disabled: this.mode == 'view'
-                            });
-                            break;
-                        case 'text':
-                            widget = new Textarea({
-                                name: 'answers',
-                                disabled: this.mode == 'view',
-                                style: 'min-height: 120px'
-                            });
-                            break;
-                        case 'singleChoice':
-                        case 'multipleChoice':
-                            widget = new MultipleChoiceWidget({
-                                name: 'answers',
-                                mode: this.mode,
-                                allowMultiple: scale == 'multipleChoice'
-                            });
-                            break;
-                    }
-                    this._widgetCache[scale] = widget;
+    'dijit/form/Textarea','../../widgets/MultipleChoiceWidget'
+], function(declare,lang,domConstruct,_WidgetBase,_TemplatedMixin,
+        _WidgetsInTemplateMixin,templateString,TextBox,Textarea,MultipleChoiceWidget){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        templateString: templateString,
+        mode: 'view', // view || edit
+        name: '',
+        value: null,
+        _scale: null,
+        _widgetCache: null,
+        constructor: function() {
+            this.inherited(arguments);
+            this.value = {};
+            this._widgetCache = {};
+        },
+        postCreate: function() {
+            this._resetValue = this.value;
+            this.scaleSelector.set('disabled', this.mode === 'edit');
+        },
+        _setValueAttr: function(value) {
+            this.value = value;
+            this._onTypeChange(value.scale || 'string');
+            this.ourForm.set('value',value);
+        },
+        _getValueAttr: function() {
+            var value = this.ourForm.get('value');
+            lang.mixin(this.value,value);
+            return this.value;
+        },
+        _onTypeChange: function(scale) {
+            if ( this._scale === scale ) { return; }
+            this._scale = scale;
+            domConstruct.empty(this.scaleDetails);
+            var widget = this._getTypeWidget(scale);
+            if ( widget ) { widget.placeAt(this.scaleDetails,'only'); }
+        },
+        _getTypeWidget: function(scale) {
+            var widget = this._widgetCache[scale];
+            if (!widget) {
+                switch(scale) {
+                case 'string':
+                    widget = new TextBox({
+                        name: 'answers',
+                        disabled: this.mode === 'view'
+                    });
+                    break;
+                case 'text':
+                    widget = new Textarea({
+                        name: 'answers',
+                        disabled: this.mode === 'view',
+                        style: 'min-height: 120px'
+                    });
+                    break;
+                case 'singleChoice':
+                case 'multipleChoice':
+                    widget = new MultipleChoiceWidget({
+                        name: 'answers',
+                        mode: this.mode,
+                        allowMultiple: scale === 'multipleChoice'
+                    });
+                    break;
                 }
-                return widget;
-            },
-            reset: function() {
-                this.ourForm.reset();
-                this._setValueAttr(this._resetValue);
+                this._widgetCache[scale] = widget;
             }
-        });
+            return widget;
+        },
+        reset: function() {
+            this.ourForm.reset();
+            this._setValueAttr(this._resetValue);
+        }
     });
+});
Index: /Dev/trunk/client/qed/model/widgets/QuestionWidgetFactory.js
===================================================================
--- /Dev/trunk/client/qed/model/widgets/QuestionWidgetFactory.js	(revision 425)
+++ /Dev/trunk/client/qed/model/widgets/QuestionWidgetFactory.js	(revision 426)
@@ -30,6 +30,7 @@
             var fun = this['create'+options.type+'EditWidget'];
             var view = fun !== undefined ? fun() : null;
-            if(view)
+            if (view) {
                 view.set('value', options);
+            }
             return view;
         },
@@ -272,9 +273,9 @@
             var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
 
-            var ctor = this.options.multiple === true ? CheckBox : RadioButton;
-            array.forEach(this.options.items || [],function(item){
-                table.addChild(new ctor({
-                        name: this.options.code || '',
-                        title: item
+            var Ctor = this.options.multiple === true ? CheckBox : RadioButton;
+            array.forEach(this.options.items || [], function(item){
+                table.addChild(new Ctor({
+                    name: this.options.code || '',
+                    title: item
                 }));
             },this);
@@ -342,10 +343,10 @@
             w.startup();
             w.set('value',item);
-            w.on('delete',lang.hitch(this,'_onRemove',w));
+            w.on('delete',lang.hitch(this,'_onRemove',w,item));
             return w.domNode;
         },
-        _onRemove: function(w) {
+        _onRemove: function(w,item) {
             w.destroyRecursive();
-            this.removeCallback && this.removeCallback(item);
+            if ( this.removeCallback ) { this.removeCallback(item); }
             this.source.sync();
         }
Index: v/trunk/client/qed/package.js
===================================================================
--- /Dev/trunk/client/qed/package.js	(revision 425)
+++ 	(revision )
@@ -1,15 +1,0 @@
-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/trunk/client/qed/package.json
===================================================================
--- /Dev/trunk/client/qed/package.json	(revision 425)
+++ /Dev/trunk/client/qed/package.json	(revision 426)
@@ -1,10 +1,15 @@
 {
-    "name": "rft",
-    "description": "Research Facilitator Tool",
-    "dependencies": {
-        "dojo": "~1.8.0",
-        "dijit": "~1.8.0",
-        "dojox": "~1.8.0"
-    },
-    "dojoBuild": "package.js"
+  "name": "qed",
+  "description": "QED",
+  "dependencies": {
+    "dojo": "~1.8.0",
+    "dijit": "~1.8.0",
+    "dojox": "~1.8.0"
+  },
+  "dojoBuild": "qed.profile.js",
+  "devDependencies": {
+    "grunt": "~0.4.0",
+    "grunt-contrib-less": "~0.5.0",
+    "grunt-contrib-jshint": "~0.2.0"
+  }
 }
Index: /Dev/trunk/client/qed/pages/question.js
===================================================================
--- /Dev/trunk/client/qed/pages/question.js	(revision 425)
+++ /Dev/trunk/client/qed/pages/question.js	(revision 426)
@@ -54,5 +54,5 @@
                 Content.notify(err,'error');
             });
-            evt && event.stop( evt );
+            if ( evt ) { event.stop( evt ); }
             return false;
         },
Index: /Dev/trunk/client/qed/pages/response.js
===================================================================
--- /Dev/trunk/client/qed/pages/response.js	(revision 425)
+++ /Dev/trunk/client/qed/pages/response.js	(revision 426)
@@ -62,5 +62,5 @@
             this._getAnswersAndSaveResponse();
             this.content.domNode.innerHTML = "<div>Thanks for filling in the survey.</div>";
-            e && event.stop(e);
+            if ( e ) { event.stop(e); }
             return false;
         },
@@ -68,9 +68,9 @@
             this._getAnswersAndSaveResponse();
             this.content.domNode.innerHTML = "<div>To continue with this survey later, just save the URL in the location bar and revisit it later. Your answers will still be there.</div>";
-            e && event.stop(e);
+            if ( e ) { event.stop(e); }
             return false;
         },
         _ignoreEvent: function(e) {
-            e && event.stop(e);
+            if ( e ) { event.stop(e); }
             return false;
         }
Index: /Dev/trunk/client/qed/pages/survey.js
===================================================================
--- /Dev/trunk/client/qed/pages/survey.js	(revision 425)
+++ /Dev/trunk/client/qed/pages/survey.js	(revision 426)
@@ -43,5 +43,7 @@
                 itemActions: {
                     "Info": {
-                        callback: function(item){ item.description && alert(item.description); },
+                        callback: function(item){
+                            if ( item.description ) { alert(item.description); }
+                        },
                         icon: "Inspect",
                         description: "Show item description"
Index: /Dev/trunk/client/qed/pages/surveys.js
===================================================================
--- /Dev/trunk/client/qed/pages/surveys.js	(revision 425)
+++ /Dev/trunk/client/qed/pages/surveys.js	(revision 426)
@@ -68,6 +68,6 @@
         refreshDrafts: function() {
             this.draftsContainer.set('content','');
-            when(store.query("_design/surveys/_view/drafts")
-                    ,lang.hitch(this,function(surveys){
+            when(store.query("_design/surveys/_view/drafts"),
+                    lang.hitch(this,function(surveys) {
                 this.draftsTab.set('title','Drafts ('+surveys.length+')');
                 array.forEach(surveys,function(survey){
@@ -110,6 +110,6 @@
         refreshPublished: function() {
             this.publishedContainer.set('content','');
-            when(store.query("_design/surveys/_view/published")
-                    ,lang.hitch(this,function(surveys){
+            when(store.query("_design/surveys/_view/published"),
+                    lang.hitch(this, function(surveys) {
                 this.publishedTab.set('title','Published ('+surveys.length+')');
                 array.forEach(surveys,function(survey){
@@ -138,6 +138,6 @@
         refreshRuns: function() {
             this.runsContainer.set('content','');
-            when(store.query("_design/default/_view/by_type",{key:'SurveyRun'})
-                    ,lang.hitch(this,function(surveyRuns){
+            when(store.query("_design/default/_view/by_type",{key:'SurveyRun'}),
+                    lang.hitch(this,function(surveyRuns){
                 this.runsTab.set('title','Runs ('+surveyRuns.length+')');
                 array.forEach(surveyRuns,function(surveyRun){
Index: /Dev/trunk/client/qed/qed.profile.js
===================================================================
--- /Dev/trunk/client/qed/qed.profile.js	(revision 426)
+++ /Dev/trunk/client/qed/qed.profile.js	(revision 426)
@@ -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/trunk/client/qed/store/CouchStore.js
===================================================================
--- /Dev/trunk/client/qed/store/CouchStore.js	(revision 425)
+++ /Dev/trunk/client/qed/store/CouchStore.js	(revision 426)
@@ -271,10 +271,12 @@
                 dfd.reject(getCouchError(err));
             });
-            return CouchResults(dfd.promise);
+            return couchResults(dfd.promise);
         }
     });
 
-    function CouchResults(results) {
-        results = QueryResults(results);
+    var queryResults = QueryResults;
+
+    function couchResults(results) {
+        results = queryResults(results);
         results.forPairs = function(callback,thisObject) {
             callback = lang.hitch(thisObject,callback);
Index: /Dev/trunk/client/qed/store/ElasticReadStore.js
===================================================================
--- /Dev/trunk/client/qed/store/ElasticReadStore.js	(revision 425)
+++ /Dev/trunk/client/qed/store/ElasticReadStore.js	(revision 426)
@@ -23,5 +23,5 @@
             });
             return this.inherited(arguments);
-          },
+        },
         _fetchItems: function(request, fetchHandler, errorHandler){
             var serverQuery = request.serverQuery;
Index: /Dev/trunk/client/qed/ui/MenuBarLink.js
===================================================================
--- /Dev/trunk/client/qed/ui/MenuBarLink.js	(revision 425)
+++ /Dev/trunk/client/qed/ui/MenuBarLink.js	(revision 426)
@@ -1,10 +1,10 @@
-define(['dojo/_base/declare','dijit/MenuBarItem','../app/Router'],
-function(declare,MenuBarItem,Router){
-    return declare([MenuBarItem],{
+define(['dojo/_base/declare','dijit/MenuBarItem','../app/Router'
+], function(declare,MenuBarItem,Router) {
+    return declare([MenuBarItem], {
         options:{
             path: null
         },
         onClick: function(){
-            this.path && Router.go(this.path);
+            if ( this.path ) { Router.go(this.path); }
         }
     });
Index: /Dev/trunk/client/qed/ui/MenuLink.js
===================================================================
--- /Dev/trunk/client/qed/ui/MenuLink.js	(revision 425)
+++ /Dev/trunk/client/qed/ui/MenuLink.js	(revision 426)
@@ -1,10 +1,10 @@
-define(['dojo/_base/declare','dijit/MenuItem','../app/Router'],
-function(declare,MenuItem,Router){
+define(['dojo/_base/declare','dijit/MenuItem','../app/Router'
+], function(declare,MenuItem,Router) {
     return declare([MenuItem],{
         options:{
             path: null
         },
-        onClick: function(){
-            this.path && Router.go(this.path);
+        onClick: function() {
+            if ( this.path ) { Router.go(this.path); }
         }
     });
Index: /Dev/trunk/client/qed/widgets/LineWithActionsWidget.js
===================================================================
--- /Dev/trunk/client/qed/widgets/LineWithActionsWidget.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/LineWithActionsWidget.js	(revision 426)
@@ -42,5 +42,5 @@
                         title: this.actions[action].properties.tooltip,
                         onClick: lang.hitch(this, function(action, e){
-                            action.callback && action.callback(e);
+                            if ( action.callback ) { action.callback(e); }
                             event.stop(e);
                             return false;
@@ -56,5 +56,5 @@
                         title: this.actions[action].properties.tooltip,
                         onClick: lang.hitch(this, function(action, e){
-                            action.callback && action.callback(e);
+                            if ( action.callback ) { action.callback(e); }
                             event.stop(e);
                             return false;
@@ -75,5 +75,5 @@
             return !preventDefault;
         },
-        onClick: function(e) {
+        onClick: function(/*e*/) {
         },
         _setTitleAttr: function(value){
Index: /Dev/trunk/client/qed/widgets/MultipleChoiceWidget.js
===================================================================
--- /Dev/trunk/client/qed/widgets/MultipleChoiceWidget.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/MultipleChoiceWidget.js	(revision 426)
@@ -3,89 +3,86 @@
     'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dijit/_Container',
     'dojo/text!./templates/MultipleChoiceWidget.html',
-    'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'],
-    function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
-        _WidgetsInTemplateMixin,_Container,
-        templateString,RadioButton,CheckBox,TextBox,Button){
-        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
-            templateString: templateString,
-            multiple: true,
-            baseClass: 'rftMultipleChoiceWidget',
-            
-            allowMultiple: false,
-            name: '',
-            value: null,
-            
-            _widgetCache: null,
-            constuctor: function() {
-                this.inherited(arguments);
-                this.value = [];
-                this._widgetCache = {};
-            },
-            _setValueAttr: function(value) {
-                this.reset();
-                this.value = value;
-                array.forEach(this.value,lang.hitch(this,function(val){
-                    this._addRow(val);
-                }));
-            },
-            _getValueAttr: function() {
-                var value = [];
-                registry.findWidgets(this.domNode).forEach(function(w){
-                    w.isInstanceOf(TextBox) && value.push(w.get('value'));
-                });
-                this.value = value;
-                return value;
-            },
-            reset: function() {
-                this._removeWidgetsBelowNode(this.rows);
-                domConstruct.empty(this.rows);
-            },
-            _onAddRow: function() {
-                this._addRow();
-            },
-            _addRow: function(value,tagRow,pos) {
-                var row = domConstruct.create('div',{'class':'row'});
-                if ( this.allowMultiple ) {
-                    new CheckBox({
-                        name:this.name,
-                        'class':'rowBox',
-                        disabled: this.mode == 'edit'
-                    }).placeAt(row);
-                } else {
-                    new RadioButton({
-                        name:this.name,
-                        'class':'rowBox',
-                        disabled: this.mode == 'edit'
-                    }).placeAt(row);
-                }
-                new TextBox({
+    'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'
+], function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
+    _WidgetsInTemplateMixin,_Container, templateString,RadioButton,CheckBox,TextBox,Button){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        templateString: templateString,
+        multiple: true,
+        baseClass: 'rftMultipleChoiceWidget',
+        
+        allowMultiple: false,
+        name: '',
+        value: null,
+        
+        _widgetCache: null,
+        constuctor: function() {
+            this.inherited(arguments);
+            this.value = [];
+            this._widgetCache = {};
+        },
+        _setValueAttr: function(value) {
+            this.reset();
+            this.value = value;
+            array.forEach(this.value,lang.hitch(this,function(val){
+                this._addRow(val);
+            }));
+        },
+        _getValueAttr: function() {
+            var value = [];
+            registry.findWidgets(this.domNode).forEach(function(w){
+                if ( w.isInstanceOf(TextBox) ) { value.push(w.get('value')); }
+            });
+            this.value = value;
+            return value;
+        },
+        reset: function() {
+            this._removeWidgetsBelowNode(this.rows);
+            domConstruct.empty(this.rows);
+        },
+        _onAddRow: function() {
+            this._addRow();
+        },
+        _addRow: function(value,tagRow,pos) {
+            var row = domConstruct.create('div',{'class':'row'});
+            if ( this.allowMultiple ) {
+                new CheckBox({
                     name:this.name,
-                    value:value || '',
-                    'class':'rowText'
+                    'class':'rowBox',
+                    disabled: this.mode === 'edit'
                 }).placeAt(row);
-                new Button({
-                    label:'-',
-                    'class':'rowBtn',
-                    onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
+            } else {
+                new RadioButton({
+                    name:this.name,
+                    'class':'rowBox',
+                    disabled: this.mode === 'edit'
                 }).placeAt(row);
-                new Button({
-                    label:'+',
-                    'class':'rowBtn',
-                    onClick:lang.hitch(this,'_addRow','',row,'before')
-                }).placeAt(row);
-                domConstruct.place(row,tagRow || this.rows,pos||'last');
-            },
-            _removeNodeWithWidgets: function(node) {
-                this._removeWidgetsBelowNode(node);
-                domConstruct.destroy(node);
-            },
-            _removeWidgetsBelowNode: function(node) {
-                registry.findWidgets(node).forEach(function(w){
-                    w.destroyRecursive();
-                });
-            },
-            _onRowChange: function(row) {
-                
             }
-        });
+            new TextBox({
+                name:this.name,
+                value:value || '',
+                'class':'rowText'
+            }).placeAt(row);
+            new Button({
+                label:'-',
+                'class':'rowBtn',
+                onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
+            }).placeAt(row);
+            new Button({
+                label:'+',
+                'class':'rowBtn',
+                onClick:lang.hitch(this,'_addRow','',row,'before')
+            }).placeAt(row);
+            domConstruct.place(row,tagRow || this.rows,pos||'last');
+        },
+        _removeNodeWithWidgets: function(node) {
+            this._removeWidgetsBelowNode(node);
+            domConstruct.destroy(node);
+        },
+        _removeWidgetsBelowNode: function(node) {
+            registry.findWidgets(node).forEach(function(w){
+                w.destroyRecursive();
+            });
+        },
+        _onRowChange: function(/*row*/) {}
     });
+});
Index: /Dev/trunk/client/qed/widgets/ObjectBox.js
===================================================================
--- /Dev/trunk/client/qed/widgets/ObjectBox.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/ObjectBox.js	(revision 426)
@@ -43,5 +43,5 @@
                 line3Actions[action] = {
                     callback: lang.hitch(this, function(callback){
-                        this.value && callback(this.value);
+                        if ( this.value ) { callback(this.value); }
                     }, this.actions[action]),
                     properties: {
@@ -54,7 +54,5 @@
             return line3Actions;
         },
-        _showInfoBox: function() {
-            alert(this.value.description);
-        },
+        _showInfoBox: function() {},
         _setValueAttr: function(value) {
             this.value = value;
Index: /Dev/trunk/client/qed/widgets/Selector.js
===================================================================
--- /Dev/trunk/client/qed/widgets/Selector.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/Selector.js	(revision 426)
@@ -70,9 +70,9 @@
                                         action.callback),
                         properties: {
-                             blockButton: true,
-                             label: action.title || actionName,
-                             icon: action.icon,
-                             tooltip: action.description
-                         }
+                            blockButton: true,
+                            label: action.title || actionName,
+                            icon: action.icon,
+                            tooltip: action.description
+                        }
 
                     };
@@ -145,5 +145,5 @@
                 this._folded = true;
             }
-            evt && event.stop(evt);
+            if ( evt ) { event.stop(evt); }
             return false;
         },
@@ -174,5 +174,5 @@
         },
 
-        onSelect: function(item) {}
+        onSelect: function(/*item*/) {}
     });
 });
Index: /Dev/trunk/client/qed/widgets/ThresholdFilteringSelect.js
===================================================================
--- /Dev/trunk/client/qed/widgets/ThresholdFilteringSelect.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/ThresholdFilteringSelect.js	(revision 426)
@@ -4,15 +4,15 @@
 ], function(declare, FilteringSelect) {
     return declare(FilteringSelect, {
-         // custom min input character count to trigger search
-         minKeyCount: 3,
+        // custom min input character count to trigger search
+        minKeyCount: 3,
 
-         // override search method, count the input length
-         _startSearch: function (/*String*/key) {
-             if (!key || key.length < this.minKeyCount) {
-                 this.closeDropDown();
-                 return;
-             }
-             this.inherited(arguments);
-         }
+        // override search method, count the input length
+        _startSearch: function (/*String*/key) {
+            if (!key || key.length < this.minKeyCount) {
+                this.closeDropDown();
+                return;
+            }
+            this.inherited(arguments);
+        }
     });
 });
Index: /Dev/trunk/client/qed/widgets/list/List.js
===================================================================
--- /Dev/trunk/client/qed/widgets/list/List.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/list/List.js	(revision 426)
@@ -52,6 +52,6 @@
             };
         },
-        _createListNode: function(item) {},
-        _createAvatarNode: function(item) {},
+        _createListNode: function(/*item*/) {},
+        _createAvatarNode: function(/*item*/) {},
 
         appendItem: function(item) {
@@ -86,5 +86,5 @@
             .forEach(lang.hitch(this,function(node){
                 registry.byNode(node).destroyRecursive();
-                this.removeCallback && this.removeCallback(item);
+                if ( this.removeCallback ) { this.removeCallback(item); }
             }));
             this.source.sync();
Index: /Dev/trunk/client/qed/widgets/list/OrderedList.js
===================================================================
--- /Dev/trunk/client/qed/widgets/list/OrderedList.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/list/OrderedList.js	(revision 426)
@@ -5,75 +5,75 @@
     './List',
     'dojo/text!./templates/OrderedList.html'
-    ],function(
-        declare,
-        lang,
-        Button,
-        List,
-        templateString
-        ){
-        return declare([List],{
-            templateString: templateString,
-            baseClass: 'rftLineListView',
+],function(
+    declare,
+    lang,
+    Button,
+    List,
+    templateString
+    ){
+    return declare([List],{
+        templateString: templateString,
+        baseClass: 'rftLineListView',
 
-            startup: function() {
-                if ( this._started ){ return; }
-                this.inherited(arguments);
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
 
-                new Button({
-                    label: "Move up",
-                    showLabel: false,
-                    iconClass: "rftIcon rftIconFullArrowUp",
-                    baseClass: "rftBlockButton",
-                    'class': "trans",
-                    onClick: lang.hitch(this, function() {
-                        this._moveSelectedItem("up");
-                    })
-                }, this.btnListMoveUp).startup();
+            new Button({
+                label: "Move up",
+                showLabel: false,
+                iconClass: "rftIcon rftIconFullArrowUp",
+                baseClass: "rftBlockButton",
+                'class': "trans",
+                onClick: lang.hitch(this, function() {
+                    this._moveSelectedItem("up");
+                })
+            }, this.btnListMoveUp).startup();
 
-                new Button({
-                    label: "Move down",
-                    showLabel: false,
-                    iconClass: "rftIcon rftIconFullArrowDown",
-                    baseClass: "rftBlockButton",
-                    'class': "trans",
-                    onClick: lang.hitch(this, function() {
-                        this._moveSelectedItem("down");
-                    })
-                }, this.btnListMoveDown).startup();
-            },
+            new Button({
+                label: "Move down",
+                showLabel: false,
+                iconClass: "rftIcon rftIconFullArrowDown",
+                baseClass: "rftBlockButton",
+                'class': "trans",
+                onClick: lang.hitch(this, function() {
+                    this._moveSelectedItem("down");
+                })
+            }, this.btnListMoveDown).startup();
+        },
 
-            _moveSelectedItem: function(dir) {
-                var node = this.source.getSelectedNodes()[0];
-                if (node) {
-                    if (dir === "up") {
-                        if (node.previousSibling) {
-                            return node.parentNode.insertBefore(node, node.previousSibling);
-                        } else {
-                            return false;
-                        }
+        _moveSelectedItem: function(dir) {
+            var node = this.source.getSelectedNodes()[0];
+            if (node) {
+                if (dir === "up") {
+                    if (node.previousSibling) {
+                        return node.parentNode.insertBefore(node, node.previousSibling);
+                    } else {
+                        return false;
+                    }
 
-                    } else if (dir === "down") {
-                        if (node.nextSibling) {
-                            return node.parentNode.insertBefore(node.nextSibling, node);
-                        } else {
-                            return false;
-                        }
+                } else if (dir === "down") {
+                    if (node.nextSibling) {
+                        return node.parentNode.insertBefore(node.nextSibling, node);
                     } else {
-                        throw "Invalid move direction passed!";
+                        return false;
                     }
                 } else {
-                    return false;
+                    throw "Invalid move direction passed!";
                 }
-            },
+            } else {
+                return false;
+            }
+        },
 
-            insertItem: function(item) {
-                var anchor = this.source.getSelectedNodes()[0];
-                if (anchor) {
-                    this.source.insertNodes(false,[item], false, anchor);
-                } else {
-                    this.appendItem(item);
-                }
+        insertItem: function(item) {
+            var anchor = this.source.getSelectedNodes()[0];
+            if (anchor) {
+                this.source.insertNodes(false,[item], false, anchor);
+            } else {
+                this.appendItem(item);
             }
+        }
 
-        });
     });
+});
Index: /Dev/trunk/client/qed/widgets/list/_EditableListMixin.js
===================================================================
--- /Dev/trunk/client/qed/widgets/list/_EditableListMixin.js	(revision 425)
+++ /Dev/trunk/client/qed/widgets/list/_EditableListMixin.js	(revision 426)
@@ -9,5 +9,5 @@
             .map(function(node){
                 var value = registry.byId(node.id).get('value');
-                this.source.setItem(node.id, value)
+                this.source.setItem(node.id, value);
                 return value;
             },this);
